posixoptions — optional parts of the POSIX standard

Description

The POSIX standard (the information below is from POSIX.1-2001) describes a set of behaviors and interfaces for a compliant system. However, many interfaces are optional and there are feature test macros to test the availability of interfaces at compile time, and functions sysconf(3), fpathconf(3), pathconf(3), confstr(3) to do this at run time. From shell scripts one can use getconf(1). For more detail, see sysconf(3).

We give the name of the POSIX abbreviation, the option, the name of the sysconf(3) parameter used to inquire about the option, and possibly a very short description. Much more precise detail can be found in the POSIX standard itself, versions of which can nowadays be accessed freely on the web.

Adv - _posix_advisory_info - _sc_advisory_info

The following advisory functions are present:

posix_fadvise()
posix_fallocate()
posix_memalign()
posix_madvise()

Aio - _posix_asynchronous_io - _sc_asynchronous_io

The header <aio.h> is present. The following functions are present:

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. 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 (as it always is under POSIX.1-2001), 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. The following functions are present:

pthread_condattr_getclock()
pthread_condattr_setclock()
clock_nanosleep()

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. The function clock_getcpuclockid() is present.

--- - _posix_file_locking - _sc_file_locking

This option has been deleted. Not in final XPG6.

FSC - _posix_fsync - _sc_fsync

The function fsync() is present.

Ip6 - _posix_ipv6 - _sc_ipv6

Internet Protocol Version 6 is supported.

--- - _posix_job_control - _sc_job_control

If this option is in effect (as 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. The following functions are present:

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, 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.

MSG - _posix_message_passing - _sc_message_passing

The include file <mqueue.h> is present. The following functions are present:

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. 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.

--- - _posix_no_trunc

If this option is in effect (as it always is under POSIX.1-2001), then pathname components longer than NAME_MAX are not truncated, but give an error. This property may be dependent on the path prefix of the component.

Pio - _posix_prioritized_io - _sc_prioritized_io

This option says that one can specify priorities for asynchronous I/O. This affects the functions

aio_read()
aio_write()

PS - _posix_priority_scheduling - _sc_priority_scheduling

The include file <sched.h> is present. The following functions are present:

sched_get_priority_max()
sched_get_priority_min()
sched_getparam()
sched_getscheduler()
sched_rr_get_interval()
sched_setparam()
sched_setscheduler()
sched_yield()

If also _POSIX_SPAWN is in effect, then the following functions are present:

posix_spawnattr_getschedparam()
posix_spawnattr_getschedpolicy()
posix_spawnattr_setschedparam()
posix_spawnattr_setschedpolicy()

RS - _posix_raw_sockets

Raw sockets are supported. The following functions are affected:

getsockopt()
setsockopt()

--- - _posix_reader_writer_locks - _sc_reader_writer_locks

This option implies the _POSIX_THREADS option. Conversely, under POSIX.1-2001 the _POSIX_THREADS option implies this option.

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 (as 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 (as 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. The following functions are present:

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 (as it always is under POSIX.1-2001), the function system() is present.

SPN - _posix_spawn - _sc_spawn

This option describes support for process creation in a context where it is 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()

If also _POSIX_PRIORITY_SCHEDULING is in effect, then the following functions are present:

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

If this option is in effect, the different threads inside a process can run with different priorities and/or different schedulers. The following functions are affected:

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

The following functions are affected:

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 following functions are affected:

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()

TSP - _posix_thread_sporadic_server - _sc_thread_sporadic_server

This option implies the _POSIX_THREAD_PRIORITY_SCHEDULING option. The following 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:

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

The following 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

The following 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 children of the traced process is supported. 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

The following functions are present:

posix_mem_offset()
posix_typed_mem_get_info()
posix_typed_mem_open()

--- - _posix_vdisable

Always present (probably 0). Value to set a changeable special control character to indicate that it is disabled.

X/Open System Interface Extensions

Xsi - _xopen_crypt - _sc_xopen_crypt

The following functions are present:

crypt()
encrypt()
setkey()

Xsi - _xopen_realtime - _sc_xopen_realtime

This option implies the following options:

_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 the following options are all 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 the following options are all defined to 200112L:

_POSIX_THREAD_PRIO_INHERIT

_POSIX_THREAD_PRIO_PROTECT

_POSIX_THREAD_PRIORITY_SCHEDULING

Advanced Realtime Threads - --- - ---

This option implies that the following options are all 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 the following options are all 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

Functions included in the legacy option group were previously mandatory, but are now optional in this version. The following functions are present:

bcmp()
bcopy()
bzero()
ecvt()
fcvt()
ftime()
gcvt()
getcwd()
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

This option may imply the following 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)

See Also

sysconf(3), standards(7)

Colophon

This page is part of release 5.04 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.

Referenced By

procenv(1), standards(7), sysconf(3).

2018-04-30 Linux Programmer's Manual