posixoptions(7)
๐ NAME ๐
posixoptions โ the optional lil extras of the POSIX standard โจ no cap, this is your cheat sheet bestie ๐ซถ
โจ DESCRIPTION โจ
okay so ๐ธ the POSIX standard (and fr, everything below is straight from POSIX.1-2001) describes a whole set of behaviours and interfaces for a system that's tryna be compliant ๐
but here's the tea: lots of those interfaces are optional ๐ญ and there's a whole toolkit for checking what's actually there:
- feature test macros โ to test availability of interfaces at compile time ๐
sysconf(3),fpathconf(3),pathconf(3),confstr(3)โ to do that same check at run time ๐ธ- from shell scripts you've got
getconf(1)๐ฆ - for way more detail, slide into
sysconf(3)๐
so how do you read the rest of this page? every entry hands you:
- the POSIX abbreviation ๐
- the option
- the
sysconf(3)parameter you use to ask about it ๐ - and possibly a very short description โจ
real talk though โ much more precise detail lives in the POSIX standard itself, and versions of that can nowadays be accessed freely on the web ๐
๐
ADV โ _POSIX_ADVISORY_INFO โ _SC_ADVISORY_INFO ๐
the following advisory functions are present, bestie:
posix_fadvise()
posix_fallocate()
posix_memalign()
posix_madvise()
๐ฆ AIO โ _POSIX_ASYNCHRONOUS_IO โ _SC_ASYNCHRONOUS_IO ๐ฆ
the header <aio.h> is present ๐ and these functions are too:
aio_cancel()
aio_error()
aio_fsync()
aio_read()
aio_return()
aio_suspend()
aio_write()
lio_listio()
๐ BAR โ _POSIX_BARRIERS โ _SC_BARRIERS ๐
this option implies the _POSIX_THREADS and _POSIX_THREAD_SAFE_FUNCTIONS options ๐ and the following functions are present:
pthread_barrier_destroy()
pthread_barrier_init()
pthread_barrier_wait()
pthread_barrierattr_destroy()
pthread_barrierattr_init()
๐ธ --- โ POSIX_CHOWN_RESTRICTED ๐ธ
if this option is in effect (and it always is under POSIX.1-2001, periodt), then only root may change the owner of a file ๐ and nonroot can set the group of a file only to one of the groups it belongs to ๐ฅ
this affects the following functions:
chown()
fchown()
โญ CS โ _POSIX_CLOCK_SELECTION โ _SC_CLOCK_SELECTION โญ
this option implies the _POSIX_TIMERS option ๐ and the following functions are present:
pthread_condattr_getclock()
pthread_condattr_setclock()
clock_nanosleep()
also: if CLOCK_REALTIME is changed by the function clock_settime(), then this affects all timers set for an absolute time ๐ฑ
๐ง CPT โ _POSIX_CPUTIME โ _SC_CPUTIME ๐ง
the CLOCK_PROCESS_CPUTIME_ID clock ID is supported ๐ซ the initial value of this clock is 0 for each process ๐ฑ this option implies the _POSIX_TIMERS option, and the function clock_getcpuclockid() is present ๐
๐ --- โ _POSIX_FILE_LOCKING โ _SC_FILE_LOCKING ๐
this option has been deleted ๐ญ not in final XPG6. rip, moving on.
๐ FSC โ _POSIX_FSYNC โ _SC_FSYNC ๐
the function fsync() is present ๐พ that's it, that's the whole vibe.
๐ IP6 โ _POSIX_IPV6 โ _SC_IPV6 ๐
Internet Protocol Version 6 is supported ๐ฐ๏ธโจ
๐ --- โ _POSIX_JOB_CONTROL โ _SC_JOB_CONTROL ๐
if this option is in effect (and yes, it always is under POSIX.1-2001), then the system implements POSIX-style job control ๐๏ธ and the following functions are present:
setpgid()
tcdrain()
tcflush()
tcgetpgrp()
tcsendbreak()
tcsetattr()
tcsetpgrp()
๐ซถ MF โ _POSIX_MAPPED_FILES โ _SC_MAPPED_FILES ๐ซถ
shared memory is supported ๐ง the include file <sys/mman.h> is present, and so are these:
mmap()
msync()
munmap()
๐ฅ ML โ _POSIX_MEMLOCK โ _SC_MEMLOCK ๐ฅ
shared memory can be locked into core ๐ the following functions are present:
mlockall()
munlockall()
โจ MR/MLR โ _POSIX_MEMLOCK_RANGE โ _SC_MEMLOCK_RANGE โจ
more precisely (iykyk): ranges can be locked into core ๐ฏ the following functions are present:
mlock()
munlock()
๐ธ MPR โ _POSIX_MEMORY_PROTECTION โ _SC_MEMORY_PROTECTION ๐ธ
the function mprotect() is present ๐ก๏ธ so iconic.
๐ฆ MSG โ _POSIX_MESSAGE_PASSING โ _SC_MESSAGE_PASSING ๐ฆ
the include file <mqueue.h> is present ๐ฌ and these functions are too:
mq_close()
mq_getattr()
mq_notify()
mq_open()
mq_receive()
mq_send()
mq_setattr()
mq_unlink()
๐ MON โ _POSIX_MONOTONIC_CLOCK โ _SC_MONOTONIC_CLOCK ๐
CLOCK_MONOTONIC is supported โณ this option implies the _POSIX_TIMERS option ๐ and the following functions are affected:
aio_suspend()
clock_getres()
clock_gettime()
clock_settime()
timer_create()
๐ --- โ _POSIX_MULTI_PROCESS โ _SC_MULTI_PROCESS ๐
this option has been deleted ๐ญ not in final XPG6. gone girl fr.
๐ง --- โ _POSIX_NO_TRUNC ๐ง
if this option is in effect (and it always is under POSIX.1-2001), then pathname components longer than NAME_MAX are not truncated โ๏ธ โ nope, they give an error ๐จ
heads up though: this property may be dependent on the path prefix of the component ๐
โญ PIO โ _POSIX_PRIORITIZED_IO โ _SC_PRIORITIZED_IO โญ
this option says you can specify priorities for asynchronous I/O ๐ it affects the functions:
aio_read()
aio_write()
๐ PS โ _POSIX_PRIORITY_SCHEDULING โ _SC_PRIORITY_SCHEDULING ๐
the include file <sched.h> is present ๐ and these functions are too:
sched_get_priority_max()
sched_get_priority_min()
sched_getparam()
sched_getscheduler()
sched_rr_get_interval()
sched_setparam()
sched_setscheduler()
sched_yield()
and if _POSIX_SPAWN is also in effect, then you also get:
posix_spawnattr_getschedparam()
posix_spawnattr_getschedpolicy()
posix_spawnattr_setschedparam()
posix_spawnattr_setschedpolicy()
๐ RS โ _POSIX_RAW_SOCKETS ๐
raw sockets are supported ๐ณ๏ธ๐ and the following functions are affected:
getsockopt()
setsockopt()
๐
--- โ _POSIX_READER_WRITER_LOCKS โ _SC_READER_WRITER_LOCKS ๐
this option implies the _POSIX_THREADS option ๐ and conversely, under POSIX.1-2001, the _POSIX_THREADS option implies this option ๐ mutual besties fr fr
the following functions are present:
pthread_rwlock_destroy()
pthread_rwlock_init()
pthread_rwlock_rdlock()
pthread_rwlock_tryrdlock()
pthread_rwlock_trywrlock()
pthread_rwlock_unlock()
pthread_rwlock_wrlock()
pthread_rwlockattr_destroy()
pthread_rwlockattr_init()
๐ฅ RTS โ _POSIX_REALTIME_SIGNALS โ _SC_REALTIME_SIGNALS ๐ฅ
realtime signals are supported โก the following functions are present:
sigqueue()
sigtimedwait()
sigwaitinfo()
๐ธ --- โ _POSIX_REGEXP โ _SC_REGEXP ๐ธ
if this option is in effect (and it always is under POSIX.1-2001), then POSIX regular expressions are supported ๐โจ and the following functions are present:
regcomp()
regerror()
regexec()
regfree()
๐ --- โ _POSIX_SAVED_IDS โ _SC_SAVED_IDS ๐
if this option is in effect (and yep, it always is under POSIX.1-2001), then a process has a saved set-user-ID and a saved set-group-ID ๐ the following functions are affected:
exec()
kill()
seteuid()
setegid()
setgid()
setuid()
๐ซถ SEM โ _POSIX_SEMAPHORES โ _SC_SEMAPHORES ๐ซถ
the include file <semaphore.h> is present ๐ฆ and the following functions are too:
sem_close()
sem_destroy()
sem_getvalue()
sem_init()
sem_open()
sem_post()
sem_trywait()
sem_unlink()
sem_wait()
โจ SHM โ _POSIX_SHARED_MEMORY_OBJECTS โ _SC_SHARED_MEMORY_OBJECTS โจ
the following functions are present:
mmap()
munmap()
shm_open()
shm_unlink()
๐ง --- โ _POSIX_SHELL โ _SC_SHELL ๐ง
if this option is in effect (and it always is under POSIX.1-2001), the function system() is present ๐ periodt.
๐ฆ SPN โ _POSIX_SPAWN โ _SC_SPAWN ๐ฆ
this option describes support for process creation in a context where it's difficult or impossible to use fork() โ for example, because no MMU is present ๐ง โ
if _POSIX_SPAWN is in effect, then the include file <spawn.h> and the following functions are present:
posix_spawn()
posix_spawn_file_actions_addclose()
posix_spawn_file_actions_adddup2()
posix_spawn_file_actions_addopen()
posix_spawn_file_actions_destroy()
posix_spawn_file_actions_init()
posix_spawnattr_destroy()
posix_spawnattr_getsigdefault()
posix_spawnattr_getflags()
posix_spawnattr_getpgroup()
posix_spawnattr_getsigmask()
posix_spawnattr_init()
posix_spawnattr_setsigdefault()
posix_spawnattr_setflags()
posix_spawnattr_setpgroup()
posix_spawnattr_setsigmask()
posix_spawnp()
and if _POSIX_PRIORITY_SCHEDULING is also in effect, then you also get:
posix_spawnattr_getschedparam()
posix_spawnattr_getschedpolicy()
posix_spawnattr_setschedparam()
posix_spawnattr_setschedpolicy()
โญ SPI โ _POSIX_SPIN_LOCKS โ _SC_SPIN_LOCKS โญ
this option implies the _POSIX_THREADS and _POSIX_THREAD_SAFE_FUNCTIONS options ๐ the following functions are present:
pthread_spin_destroy()
pthread_spin_init()
pthread_spin_lock()
pthread_spin_trylock()
pthread_spin_unlock()
๐ SS โ _POSIX_SPORADIC_SERVER โ _SC_SPORADIC_SERVER ๐
the scheduling policy SCHED_SPORADIC is supported ๐๏ธ this option implies the _POSIX_PRIORITY_SCHEDULING option ๐ the following functions are affected:
sched_setparam()
sched_setscheduler()
๐ธ SIO โ _POSIX_SYNCHRONIZED_IO โ _SC_SYNCHRONIZED_IO ๐ธ
the following functions are affected:
open()
msync()
fsync()
fdatasync()
๐ TSA โ _POSIX_THREAD_ATTR_STACKADDR โ _SC_THREAD_ATTR_STACKADDR ๐
the following functions are affected:
pthread_attr_getstack()
pthread_attr_getstackaddr()
pthread_attr_setstack()
pthread_attr_setstackaddr()
๐ TSS โ _POSIX_THREAD_ATTR_STACKSIZE โ _SC_THREAD_ATTR_STACKSIZE ๐
the following functions are affected:
pthread_attr_getstack()
pthread_attr_getstacksize()
pthread_attr_setstack()
pthread_attr_setstacksize()
๐ง TCT โ _POSIX_THREAD_CPUTIME โ _SC_THREAD_CPUTIME ๐ง
the clockID CLOCK_THREAD_CPUTIME_ID is supported โฑ๏ธ this option implies the _POSIX_TIMERS option ๐ฑ the following functions are affected:
pthread_getcpuclockid()
clock_getres()
clock_gettime()
clock_settime()
timer_create()
๐ฅ TPI โ _POSIX_THREAD_PRIO_INHERIT โ _SC_THREAD_PRIO_INHERIT ๐ฅ
the following functions are affected:
pthread_mutexattr_getprotocol()
pthread_mutexattr_setprotocol()
๐ TPP โ _POSIX_THREAD_PRIO_PROTECT โ _SC_THREAD_PRIO_PROTECT ๐
the following functions are affected:
pthread_mutex_getprioceiling()
pthread_mutex_setprioceiling()
pthread_mutexattr_getprioceiling()
pthread_mutexattr_getprotocol()
pthread_mutexattr_setprioceiling()
pthread_mutexattr_setprotocol()
TPS โ _POSIX_THREAD_PRIORITY_SCHEDULING โ _SC_THREAD_PRIORITY_SCHEDULING
okay so if this option is in effect, the different threads inside a process can each run with their own priorities and/or their own schedulers. every thread gets its own little personality, we love that for them. ๐ the functions affected are:
pthread_attr_getinheritsched()pthread_attr_getschedpolicy()pthread_attr_getscope()pthread_attr_setinheritsched()pthread_attr_setschedpolicy()pthread_attr_setscope()pthread_getschedparam()pthread_setschedparam()pthread_setschedprio()
TSH โ _POSIX_THREAD_PROCESS_SHARED โ _SC_THREAD_PROCESS_SHARED
these functions are affected, bestie:
pthread_barrierattr_getpshared()pthread_barrierattr_setpshared()pthread_condattr_getpshared()pthread_condattr_setpshared()pthread_mutexattr_getpshared()pthread_mutexattr_setpshared()pthread_rwlockattr_getpshared()pthread_rwlockattr_setpshared()
TSF โ _POSIX_THREAD_SAFE_FUNCTIONS โ _SC_THREAD_SAFE_FUNCTIONS
the functions affected are, and I need you to breathe, it's a lot:
readdir_r()getgrgid_r()getgrnam_r()getpwnam_r()getpwuid_r()flockfile()ftrylockfile()funlockfile()getc_unlocked()getchar_unlocked()putc_unlocked()putchar_unlocked()rand_r()strerror_r()strtok_r()asctime_r()ctime_r()gmtime_r()localtime_r()
notice how many of them end in _r? that's not a vibe, that's a whole naming convention. ๐
TSP โ _POSIX_THREAD_SPORADIC_SERVER โ _SC_THREAD_SPORADIC_SERVER
this option implies the _POSIX_THREAD_PRIORITY_SCHEDULING option, like it's pulling rank. ๐
these functions are affected:
sched_getparam()sched_setparam()sched_setscheduler()
THR โ _POSIX_THREADS โ _SC_THREADS
basic support for POSIX threads is available. the following functions are present, and this is the full roster, no gatekeeping:
pthread_atfork()pthread_attr_destroy()pthread_attr_getdetachstate()pthread_attr_getschedparam()pthread_attr_init()pthread_attr_setdetachstate()pthread_attr_setschedparam()pthread_cancel()pthread_cleanup_push()pthread_cleanup_pop()pthread_cond_broadcast()pthread_cond_destroy()pthread_cond_init()pthread_cond_signal()pthread_cond_timedwait()pthread_cond_wait()pthread_condattr_destroy()pthread_condattr_init()pthread_create()pthread_detach()pthread_equal()pthread_exit()pthread_getspecific()pthread_join()pthread_key_create()pthread_key_delete()pthread_mutex_destroy()pthread_mutex_init()pthread_mutex_lock()pthread_mutex_trylock()pthread_mutex_unlock()pthread_mutexattr_destroy()pthread_mutexattr_init()pthread_once()pthread_rwlock_destroy()pthread_rwlock_init()pthread_rwlock_rdlock()pthread_rwlock_tryrdlock()pthread_rwlock_trywrlock()pthread_rwlock_unlock()pthread_rwlock_wrlock()pthread_rwlockattr_destroy()pthread_rwlockattr_init()pthread_self()pthread_setcancelstate()pthread_setcanceltype()pthread_setspecific()pthread_testcancel()
TMO โ _POSIX_TIMEOUTS โ _SC_TIMEOUTS
these functions are present:
mq_timedreceive()mq_timedsend()pthread_mutex_timedlock()pthread_rwlock_timedrdlock()pthread_rwlock_timedwrlock()sem_timedwait()posix_trace_timedgetnext_event()
TMR โ _POSIX_TIMERS โ _SC_TIMERS
these functions are present:
clock_getres()clock_gettime()clock_settime()nanosleep()timer_create()timer_delete()timer_gettime()timer_getoverrun()timer_settime()
TRC โ _POSIX_TRACE โ _SC_TRACE
POSIX tracing is available. the following functions are present:
posix_trace_attr_destroy()posix_trace_attr_getclockres()posix_trace_attr_getcreatetime()posix_trace_attr_getgenversion()posix_trace_attr_getmaxdatasize()posix_trace_attr_getmaxsystemeventsize()posix_trace_attr_getmaxusereventsize()posix_trace_attr_getname()posix_trace_attr_getstreamfullpolicy()posix_trace_attr_getstreamsize()posix_trace_attr_init()posix_trace_attr_setmaxdatasize()posix_trace_attr_setname()posix_trace_attr_setstreamsize()posix_trace_attr_setstreamfullpolicy()posix_trace_clear()posix_trace_create()posix_trace_event()posix_trace_eventid_equal()posix_trace_eventid_get_name()posix_trace_eventid_open()posix_trace_eventtypelist_getnext_id()posix_trace_eventtypelist_rewind()posix_trace_flush()posix_trace_get_attr()posix_trace_get_status()posix_trace_getnext_event()posix_trace_shutdown()posix_trace_start()posix_trace_stop()posix_trace_trygetnext_event()
TEF โ _POSIX_TRACE_EVENT_FILTER โ _SC_TRACE_EVENT_FILTER
this option implies the _POSIX_TRACE option. the following functions are present:
posix_trace_eventset_add()posix_trace_eventset_del()posix_trace_eventset_empty()posix_trace_eventset_fill()posix_trace_eventset_ismember()posix_trace_get_filter()posix_trace_set_filter()posix_trace_trid_eventid_open()
TRI โ _POSIX_TRACE_INHERIT โ _SC_TRACE_INHERIT
tracing the children of the traced process is supported (the nepo babies get traced too ๐ผ). this option implies the _POSIX_TRACE option. the following functions are present:
posix_trace_attr_getinherited()posix_trace_attr_setinherited()
TRL โ _POSIX_TRACE_LOG โ _SC_TRACE_LOG
this option implies the _POSIX_TRACE option. the following functions are present:
posix_trace_attr_getlogfullpolicy()posix_trace_attr_getlogsize()posix_trace_attr_setlogfullpolicy()posix_trace_attr_setlogsize()posix_trace_close()posix_trace_create_withlog()posix_trace_open()posix_trace_rewind()
TYM โ _POSIX_TYPED_MEMORY_OBJECTS โ _SC_TYPED_MEMORY_OBJECT
these functions are present:
posix_mem_offset()posix_typed_mem_get_info()posix_typed_mem_open()
--- โ _POSIX_VDISABLE
always present (probably 0). it's the value you set a changeable special control character to when you want to say nope, that one's disabled. ๐
โจ X/OPEN SYSTEM INTERFACE EXTENSIONS โจ
XSI โ _XOPEN_CRYPT โ _SC_XOPEN_CRYPT
these functions are present:
crypt()encrypt()setkey()
XSI โ _XOPEN_REALTIME โ _SC_XOPEN_REALTIME
this option implies the following options, and they said "and I took that personally":
_POSIX_ASYNCHRONOUS_IO==200112L_POSIX_FSYNC_POSIX_MAPPED_FILES_POSIX_MEMLOCK==200112L_POSIX_MEMLOCK_RANGE==200112L_POSIX_MEMORY_PROTECTION_POSIX_MESSAGE_PASSING==200112L_POSIX_PRIORITIZED_IO_POSIX_PRIORITY_SCHEDULING==200112L_POSIX_REALTIME_SIGNALS==200112L_POSIX_SEMAPHORES==200112L_POSIX_SHARED_MEMORY_OBJECTS==200112L_POSIX_SYNCHRONIZED_IO==200112L_POSIX_TIMERS==200112L
ADV โ --- โ ---
the Advanced Realtime option group implies that all of the following options are defined to 200112L:
_POSIX_ADVISORY_INFO_POSIX_CLOCK_SELECTIONโ (implies_POSIX_TIMERS)_POSIX_CPUTIMEโ (implies_POSIX_TIMERS)_POSIX_MONOTONIC_CLOCKโ (implies_POSIX_TIMERS)_POSIX_SPAWN_POSIX_SPORADIC_SERVERโ (implies_POSIX_PRIORITY_SCHEDULING)_POSIX_TIMEOUTS_POSIX_TYPED_MEMORY_OBJECTS
XSI โ _XOPEN_REALTIME_THREADS โ _SC_XOPEN_REALTIME_THREADS
this option implies that all of the following options are defined to 200112L:
_POSIX_THREAD_PRIO_INHERIT_POSIX_THREAD_PRIO_PROTECT_POSIX_THREAD_PRIORITY_SCHEDULING
ADVANCED REALTIME THREADS โ --- โ ---
this option implies that all of the following options are defined to 200112L:
_POSIX_BARRIERSโ (implies_POSIX_THREADS,_POSIX_THREAD_SAFE_FUNCTIONS)_POSIX_SPIN_LOCKSโ (implies_POSIX_THREADS,_POSIX_THREAD_SAFE_FUNCTIONS)_POSIX_THREAD_CPUTIMEโ (implies_POSIX_TIMERS)_POSIX_THREAD_SPORADIC_SERVERโ (implies_POSIX_THREAD_PRIORITY_SCHEDULING)
TRACING โ --- โ ---
this option implies that all of the following options are defined to 200112L:
_POSIX_TRACE_POSIX_TRACE_EVENT_FILTER_POSIX_TRACE_LOG_POSIX_TRACE_INHERIT
STREAMS โ _XOPEN_STREAMS โ _SC_XOPEN_STREAMS
the following functions are present:
fattach()fdetach()getmsg()getpmsg()ioctl()isastream()putmsg()putpmsg()
XSI โ _XOPEN_LEGACY โ _SC_XOPEN_LEGACY
the functions in the legacy option group used to be mandatory and are now optional in this version โ they're not canceled, they're just freelance now. ๐ซถ the following functions are present:
bcmp()bcopy()bzero()ecvt()fcvt()ftime()gcvt()getwd()index()mktemp()rindex()utimes()wcswcs()
XSI โ _XOPEN_UNIX โ _SC_XOPEN_UNIX
the following functions are present:
mmap()munmap()msync()
this option implies the following options:
_POSIX_FSYNC_POSIX_MAPPED_FILES_POSIX_MEMORY_PROTECTION_POSIX_THREAD_ATTR_STACKADDR_POSIX_THREAD_ATTR_STACKSIZE_POSIX_THREAD_PROCESS_SHARED_POSIX_THREAD_SAFE_FUNCTIONS_POSIX_THREADS
and it may imply these options from the XSI option groups:
- Encryption (
_XOPEN_CRYPT) - Realtime (
_XOPEN_REALTIME) - Advanced Realtime (
ADB) - Realtime Threads (
_XOPEN_REALTIME_THREADS) - Advanced Realtime Threads (
ADVANCED REALTIME THREADS) - Tracing (
TRACING) - XSI Streams (
STREAMS) - Legacy (
_XOPEN_LEGACY)
heads up bestie: notice it says may imply for that last list, not does. don't go assuming, that's a whole different energy. ๐
๐ SEE ALSO ๐
and that's the whole page, you absolute scholar. ๐โจ this one's from Linux man-pages 6.20, dated 2026-02-08, filed under posixoptions(7) โ go drink some water and then check your feature test macros, mwah. ๐๐๐ฆ
๐ฆ where this page comes from
- arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- ๐ the page's license: GPL-2.0-or-later
- Copyright 2003, Andries E. Brouwer <aeb@cwi.nl>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms