1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
3 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 .\" GNU General Public License for more details.
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, see
21 .\" <http://www.gnu.org/licenses/>.
24 .TH POSIXOPTIONS 7 2018-04-30 "" "Linux Programmer's Manual"
26 posixoptions \- optional parts of the POSIX standard
28 The POSIX standard (the information below is from POSIX.1-2001)
29 describes a set of behaviors and interfaces for a compliant system.
30 However, many interfaces are optional and there are feature test macros
31 to test the availability of interfaces at compile time, and functions
36 to do this at run time.
37 From shell scripts one can use
42 We give the name of the POSIX abbreviation, the option, the name of the
44 parameter used to inquire about the option, and possibly
45 a very short description.
46 Much more precise detail can be found in the POSIX standard itself,
47 versions of which can nowadays be accessed freely on the web.
48 .SS ADV - _POSIX_ADVISORY_INFO - _SC_ADVISORY_INFO
49 The following advisory functions are present:
54 .IR posix_fallocate ()
59 .SS AIO - _POSIX_ASYNCHRONOUS_IO - _SC_ASYNCHRONOUS_IO
63 The following functions are present:
77 .SS BAR - _POSIX_BARRIERS - _SC_BARRIERS
78 This option implies the
81 .B _POSIX_THREAD_SAFE_FUNCTIONS
83 The following functions are present:
87 .IR pthread_barrier_destroy ()
88 .IR pthread_barrier_init ()
89 .IR pthread_barrier_wait ()
90 .IR pthread_barrierattr_destroy ()
91 .IR pthread_barrierattr_init ()
95 .\" Batch environment.
98 .SS --- - POSIX_CHOWN_RESTRICTED
99 If this option is in effect (as it always is under POSIX.1-2001),
100 then only root may change the owner of a file, and nonroot can
101 set the group of a file only to one of the groups it belongs to.
102 This affects the following functions
110 .\" What about lchown() ?
111 .SS CS - _POSIX_CLOCK_SELECTION - _SC_CLOCK_SELECTION
112 This option implies the
115 The following functions are present:
119 .IR pthread_condattr_getclock ()
120 .IR pthread_condattr_setclock ()
121 .IR clock_nanosleep ()
127 is changed by the function
128 .IR clock_settime (),
129 then this affects all timers set for an absolute time.
130 .SS CPT - _POSIX_CPUTIME - _SC_CPUTIME
132 .B CLOCK_PROCESS_CPUTIME_ID
133 clock ID is supported.
134 The initial value of this clock is 0 for each process.
135 This option implies the
139 .IR clock_getcpuclockid ()
142 .\" Fortran development
145 .SS --- - _POSIX_FILE_LOCKING - _SC_FILE_LOCKING
146 This option has been deleted.
148 .SS FSC - _POSIX_FSYNC - _SC_FSYNC
152 .SS IP6 - _POSIX_IPV6 - _SC_IPV6
153 Internet Protocol Version 6 is supported.
154 .SS --- - _POSIX_JOB_CONTROL - _SC_JOB_CONTROL
155 If this option is in effect (as it always is under POSIX.1-2001),
156 then the system implements POSIX-style job control,
157 and the following functions are present:
170 .SS MF - _POSIX_MAPPED_FILES - _SC_MAPPED_FILES
171 Shared memory is supported.
175 The following functions are present:
184 .SS ML - _POSIX_MEMLOCK - _SC_MEMLOCK
185 Shared memory can be locked into core.
186 The following functions are present:
194 .SS MR/MLR - _POSIX_MEMLOCK_RANGE - _SC_MEMLOCK_RANGE
195 More precisely, ranges can be locked into core.
196 The following functions are present:
204 .SS MPR - _POSIX_MEMORY_PROTECTION - _SC_MEMORY_PROTECTION
208 .SS MSG - _POSIX_MESSAGE_PASSING - _SC_MESSAGE_PASSING
212 The following functions are present:
226 .SS MON - _POSIX_MONOTONIC_CLOCK - _SC_MONOTONIC_CLOCK
229 This option implies the
232 The following functions are affected:
243 .SS --- - _POSIX_MULTI_PROCESS - _SC_MULTI_PROCESS
244 This option has been deleted.
247 .\" IEC 60559 Floating-Point Option.
248 .SS --- - _POSIX_NO_TRUNC
249 If this option is in effect (as it always is under POSIX.1-2001),
250 then pathname components longer than
254 This property may be dependent on the path prefix of the component.
255 .SS PIO - _POSIX_PRIORITIZED_IO - _SC_PRIORITIZED_IO
256 This option says that one can specify priorities for asynchronous I/O.
257 This affects the functions
265 .SS PS - _POSIX_PRIORITY_SCHEDULING - _SC_PRIORITY_SCHEDULING
269 The following functions are present:
273 .IR sched_get_priority_max ()
274 .IR sched_get_priority_min ()
275 .IR sched_getparam ()
276 .IR sched_getscheduler ()
277 .IR sched_rr_get_interval ()
278 .IR sched_setparam ()
279 .IR sched_setscheduler ()
286 is in effect, then the following functions are present:
290 .IR posix_spawnattr_getschedparam ()
291 .IR posix_spawnattr_getschedpolicy ()
292 .IR posix_spawnattr_setschedparam ()
293 .IR posix_spawnattr_setschedpolicy ()
296 .SS RS - _POSIX_RAW_SOCKETS
297 Raw sockets are supported.
298 The following functions are affected:
306 .SS --- - _POSIX_READER_WRITER_LOCKS - _SC_READER_WRITER_LOCKS
307 This option implies the
311 under POSIX.1-2001 the
313 option implies this option.
315 The following functions are present:
319 .IR pthread_rwlock_destroy ()
320 .IR pthread_rwlock_init ()
321 .IR pthread_rwlock_rdlock ()
322 .IR pthread_rwlock_tryrdlock ()
323 .IR pthread_rwlock_trywrlock ()
324 .IR pthread_rwlock_unlock ()
325 .IR pthread_rwlock_wrlock ()
326 .IR pthread_rwlockattr_destroy ()
327 .IR pthread_rwlockattr_init ()
330 .SS RTS - _POSIX_REALTIME_SIGNALS - _SC_REALTIME_SIGNALS
331 Realtime signals are supported.
332 The following functions are present:
341 .SS --- - _POSIX_REGEXP - _SC_REGEXP
342 If this option is in effect (as it always is under POSIX.1-2001),
343 then POSIX regular expressions are supported
344 and the following functions are present:
354 .SS --- - _POSIX_SAVED_IDS - _SC_SAVED_IDS
355 If this option is in effect (as it always is under POSIX.1-2001),
356 then a process has a saved set-user-ID and a saved set-group-ID.
357 The following functions are affected:
370 .\" Software development
371 .SS SEM - _POSIX_SEMAPHORES - _SC_SEMAPHORES
375 The following functions are present:
390 .SS SHM - _POSIX_SHARED_MEMORY_OBJECTS - _SC_SHARED_MEMORY_OBJECTS
391 The following functions are present:
401 .SS --- - _POSIX_SHELL - _SC_SHELL
402 If this option is in effect (as it always is under POSIX.1-2001),
406 .SS SPN - _POSIX_SPAWN - _SC_SPAWN
407 This option describes support for process creation in a context where
408 it is difficult or impossible to use
410 for example, because no MMU is present.
414 is in effect, then the include file
416 and the following functions are present:
421 .IR posix_spawn_file_actions_addclose ()
422 .IR posix_spawn_file_actions_adddup2 ()
423 .IR posix_spawn_file_actions_addopen ()
424 .IR posix_spawn_file_actions_destroy ()
425 .IR posix_spawn_file_actions_init ()
426 .IR posix_spawnattr_destroy ()
427 .IR posix_spawnattr_getsigdefault ()
428 .IR posix_spawnattr_getflags ()
429 .IR posix_spawnattr_getpgroup ()
430 .IR posix_spawnattr_getsigmask ()
431 .IR posix_spawnattr_init ()
432 .IR posix_spawnattr_setsigdefault ()
433 .IR posix_spawnattr_setflags ()
434 .IR posix_spawnattr_setpgroup ()
435 .IR posix_spawnattr_setsigmask ()
441 .B _POSIX_PRIORITY_SCHEDULING
443 the following functions are present:
447 .IR posix_spawnattr_getschedparam ()
448 .IR posix_spawnattr_getschedpolicy ()
449 .IR posix_spawnattr_setschedparam ()
450 .IR posix_spawnattr_setschedpolicy ()
453 .SS SPI - _POSIX_SPIN_LOCKS - _SC_SPIN_LOCKS
454 This option implies the
457 .B _POSIX_THREAD_SAFE_FUNCTIONS
459 The following functions are present:
463 .IR pthread_spin_destroy ()
464 .IR pthread_spin_init ()
465 .IR pthread_spin_lock ()
466 .IR pthread_spin_trylock ()
467 .IR pthread_spin_unlock ()
470 .SS SS - _POSIX_SPORADIC_SERVER - _SC_SPORADIC_SERVER
471 The scheduling policy
474 This option implies the
475 .B _POSIX_PRIORITY_SCHEDULING
477 The following functions are affected:
481 .IR sched_setparam ()
482 .IR sched_setscheduler ()
485 .SS SIO - _POSIX_SYNCHRONIZED_IO - _SC_SYNCHRONIZED_IO
486 The following functions are affected:
496 .SS TSA - _POSIX_THREAD_ATTR_STACKADDR - _SC_THREAD_ATTR_STACKADDR
497 The following functions are affected:
501 .IR pthread_attr_getstack ()
502 .IR pthread_attr_getstackaddr ()
503 .IR pthread_attr_setstack ()
504 .IR pthread_attr_setstackaddr ()
507 .SS TSS - _POSIX_THREAD_ATTR_STACKSIZE - _SC_THREAD_ATTR_STACKSIZE
508 The following functions are affected:
512 .IR pthread_attr_getstack ()
513 .IR pthread_attr_getstacksize ()
514 .IR pthread_attr_setstack ()
515 .IR pthread_attr_setstacksize ()
518 .SS TCT - _POSIX_THREAD_CPUTIME - _SC_THREAD_CPUTIME
519 The clockID CLOCK_THREAD_CPUTIME_ID is supported.
520 This option implies the
523 The following functions are affected:
527 .IR pthread_getcpuclockid ()
534 .SS TPI - _POSIX_THREAD_PRIO_INHERIT - _SC_THREAD_PRIO_INHERIT
535 The following functions are affected:
539 .IR pthread_mutexattr_getprotocol ()
540 .IR pthread_mutexattr_setprotocol ()
543 .SS TPP - _POSIX_THREAD_PRIO_PROTECT - _SC_THREAD_PRIO_PROTECT
544 The following functions are affected:
548 .IR pthread_mutex_getprioceiling ()
549 .IR pthread_mutex_setprioceiling ()
550 .IR pthread_mutexattr_getprioceiling ()
551 .IR pthread_mutexattr_getprotocol ()
552 .IR pthread_mutexattr_setprioceiling ()
553 .IR pthread_mutexattr_setprotocol ()
556 .SS TPS - _POSIX_THREAD_PRIORITY_SCHEDULING - _SC_THREAD_PRIORITY_SCHEDULING
557 If this option is in effect, the different threads inside a process
558 can run with different priorities and/or different schedulers.
559 The following functions are affected:
563 .IR pthread_attr_getinheritsched ()
564 .IR pthread_attr_getschedpolicy ()
565 .IR pthread_attr_getscope ()
566 .IR pthread_attr_setinheritsched ()
567 .IR pthread_attr_setschedpolicy ()
568 .IR pthread_attr_setscope ()
569 .IR pthread_getschedparam ()
570 .IR pthread_setschedparam ()
571 .IR pthread_setschedprio ()
574 .SS TSH - _POSIX_THREAD_PROCESS_SHARED - _SC_THREAD_PROCESS_SHARED
575 The following functions are affected:
579 .IR pthread_barrierattr_getpshared ()
580 .IR pthread_barrierattr_setpshared ()
581 .IR pthread_condattr_getpshared ()
582 .IR pthread_condattr_setpshared ()
583 .IR pthread_mutexattr_getpshared ()
584 .IR pthread_mutexattr_setpshared ()
585 .IR pthread_rwlockattr_getpshared ()
586 .IR pthread_rwlockattr_setpshared ()
589 .SS TSF - _POSIX_THREAD_SAFE_FUNCTIONS - _SC_THREAD_SAFE_FUNCTIONS
590 The following functions are affected:
603 .IR getchar_unlocked ()
605 .IR putchar_unlocked ()
615 .SS TSP - _POSIX_THREAD_SPORADIC_SERVER - _SC_THREAD_SPORADIC_SERVER
616 This option implies the
617 .B _POSIX_THREAD_PRIORITY_SCHEDULING
619 The following functions are affected:
623 .IR sched_getparam ()
624 .IR sched_setparam ()
625 .IR sched_setscheduler ()
628 .SS THR - _POSIX_THREADS - _SC_THREADS
629 Basic support for POSIX threads is available.
630 The following functions are present:
634 .IR pthread_atfork ()
635 .IR pthread_attr_destroy ()
636 .IR pthread_attr_getdetachstate ()
637 .IR pthread_attr_getschedparam ()
638 .IR pthread_attr_init ()
639 .IR pthread_attr_setdetachstate ()
640 .IR pthread_attr_setschedparam ()
641 .IR pthread_cancel ()
642 .IR pthread_cleanup_push ()
643 .IR pthread_cleanup_pop ()
644 .IR pthread_cond_broadcast ()
645 .IR pthread_cond_destroy ()
646 .IR pthread_cond_init ()
647 .IR pthread_cond_signal ()
648 .IR pthread_cond_timedwait ()
649 .IR pthread_cond_wait ()
650 .IR pthread_condattr_destroy ()
651 .IR pthread_condattr_init ()
652 .IR pthread_create ()
653 .IR pthread_detach ()
656 .IR pthread_getspecific ()
658 .IR pthread_key_create ()
659 .IR pthread_key_delete ()
660 .IR pthread_mutex_destroy ()
661 .IR pthread_mutex_init ()
662 .IR pthread_mutex_lock ()
663 .IR pthread_mutex_trylock ()
664 .IR pthread_mutex_unlock ()
665 .IR pthread_mutexattr_destroy ()
666 .IR pthread_mutexattr_init ()
668 .IR pthread_rwlock_destroy ()
669 .IR pthread_rwlock_init ()
670 .IR pthread_rwlock_rdlock ()
671 .IR pthread_rwlock_tryrdlock ()
672 .IR pthread_rwlock_trywrlock ()
673 .IR pthread_rwlock_unlock ()
674 .IR pthread_rwlock_wrlock ()
675 .IR pthread_rwlockattr_destroy ()
676 .IR pthread_rwlockattr_init ()
678 .IR pthread_setcancelstate ()
679 .IR pthread_setcanceltype ()
680 .IR pthread_setspecific ()
681 .IR pthread_testcancel ()
684 .SS TMO - _POSIX_TIMEOUTS - _SC_TIMEOUTS
685 The following functions are present:
689 .IR mq_timedreceive ()
691 .IR pthread_mutex_timedlock ()
692 .IR pthread_rwlock_timedrdlock ()
693 .IR pthread_rwlock_timedwrlock ()
695 .IR posix_trace_timedgetnext_event ()
698 .SS TMR - _POSIX_TIMERS - _SC_TIMERS
699 The following functions are present:
710 .IR timer_getoverrun ()
714 .SS TRC - _POSIX_TRACE - _SC_TRACE
715 POSIX tracing is available.
716 The following functions are present:
720 .IR posix_trace_attr_destroy ()
721 .IR posix_trace_attr_getclockres ()
722 .IR posix_trace_attr_getcreatetime ()
723 .IR posix_trace_attr_getgenversion ()
724 .IR posix_trace_attr_getmaxdatasize ()
725 .IR posix_trace_attr_getmaxsystemeventsize ()
726 .IR posix_trace_attr_getmaxusereventsize ()
727 .IR posix_trace_attr_getname ()
728 .IR posix_trace_attr_getstreamfullpolicy ()
729 .IR posix_trace_attr_getstreamsize ()
730 .IR posix_trace_attr_init ()
731 .IR posix_trace_attr_setmaxdatasize ()
732 .IR posix_trace_attr_setname ()
733 .IR posix_trace_attr_setstreamsize ()
734 .IR posix_trace_attr_setstreamfullpolicy ()
735 .IR posix_trace_clear ()
736 .IR posix_trace_create ()
737 .IR posix_trace_event ()
738 .IR posix_trace_eventid_equal ()
739 .IR posix_trace_eventid_get_name ()
740 .IR posix_trace_eventid_open ()
741 .IR posix_trace_eventtypelist_getnext_id ()
742 .IR posix_trace_eventtypelist_rewind ()
743 .IR posix_trace_flush ()
744 .IR posix_trace_get_attr ()
745 .IR posix_trace_get_status ()
746 .IR posix_trace_getnext_event ()
747 .IR posix_trace_shutdown ()
748 .IR posix_trace_start ()
749 .IR posix_trace_stop ()
750 .IR posix_trace_trygetnext_event ()
753 .SS TEF - _POSIX_TRACE_EVENT_FILTER - _SC_TRACE_EVENT_FILTER
754 This option implies the
757 The following functions are present:
761 .IR posix_trace_eventset_add ()
762 .IR posix_trace_eventset_del ()
763 .IR posix_trace_eventset_empty ()
764 .IR posix_trace_eventset_fill ()
765 .IR posix_trace_eventset_ismember ()
766 .IR posix_trace_get_filter ()
767 .IR posix_trace_set_filter ()
768 .IR posix_trace_trid_eventid_open ()
771 .SS TRI - _POSIX_TRACE_INHERIT - _SC_TRACE_INHERIT
772 Tracing children of the traced process is supported.
773 This option implies the
776 The following functions are present:
780 .IR posix_trace_attr_getinherited ()
781 .IR posix_trace_attr_setinherited ()
784 .SS TRL - _POSIX_TRACE_LOG - _SC_TRACE_LOG
785 This option implies the
788 The following functions are present:
792 .IR posix_trace_attr_getlogfullpolicy ()
793 .IR posix_trace_attr_getlogsize ()
794 .IR posix_trace_attr_setlogfullpolicy ()
795 .IR posix_trace_attr_setlogsize ()
796 .IR posix_trace_close ()
797 .IR posix_trace_create_withlog ()
798 .IR posix_trace_open ()
799 .IR posix_trace_rewind ()
802 .SS TYM - _POSIX_TYPED_MEMORY_OBJECTS - _SC_TYPED_MEMORY_OBJECT
803 The following functions are present:
807 .IR posix_mem_offset ()
808 .IR posix_typed_mem_get_info ()
809 .IR posix_typed_mem_open ()
812 .SS --- - _POSIX_VDISABLE
813 Always present (probably 0).
814 Value to set a changeable special control
815 character to indicate that it is disabled.
816 .SH X/OPEN SYSTEM INTERFACE EXTENSIONS
817 .SS XSI - _XOPEN_CRYPT - _SC_XOPEN_CRYPT
818 The following functions are present:
826 .SS XSI - _XOPEN_REALTIME - _SC_XOPEN_REALTIME
827 This option implies the following options:
831 .BR _POSIX_ASYNCHRONOUS_IO == 200112L
835 .B _POSIX_MAPPED_FILES
837 .BR _POSIX_MEMLOCK == 200112L
839 .BR _POSIX_MEMLOCK_RANGE == 200112L
841 .B _POSIX_MEMORY_PROTECTION
843 .BR _POSIX_MESSAGE_PASSING == 200112L
845 .B _POSIX_PRIORITIZED_IO
847 .BR _POSIX_PRIORITY_SCHEDULING == 200112L
849 .BR _POSIX_REALTIME_SIGNALS == 200112L
851 .BR _POSIX_SEMAPHORES == 200112L
853 .BR _POSIX_SHARED_MEMORY_OBJECTS == 200112L
855 .BR _POSIX_SYNCHRONIZED_IO == 200112L
857 .BR _POSIX_TIMERS == 200112L
861 The Advanced Realtime option group implies that the following options
862 are all defined to 200112L:
866 .B _POSIX_ADVISORY_INFO
868 .B _POSIX_CLOCK_SELECTION
876 .B _POSIX_MONOTONIC_CLOCK
882 .B _POSIX_SPORADIC_SERVER
884 .BR _POSIX_PRIORITY_SCHEDULING )
888 .B _POSIX_TYPED_MEMORY_OBJECTS
891 .SS XSI - _XOPEN_REALTIME_THREADS - _SC_XOPEN_REALTIME_THREADS
892 This option implies that the following options
893 are all defined to 200112L:
897 .B _POSIX_THREAD_PRIO_INHERIT
899 .B _POSIX_THREAD_PRIO_PROTECT
901 .B _POSIX_THREAD_PRIORITY_SCHEDULING
903 .SS ADVANCED REALTIME THREADS - --- - ---
904 This option implies that the following options
905 are all defined to 200112L:
912 .BR _POSIX_THREAD_SAFE_FUNCTIONS )
917 .BR _POSIX_THREAD_SAFE_FUNCTIONS )
919 .B _POSIX_THREAD_CPUTIME
923 .B _POSIX_THREAD_SPORADIC_SERVER
925 .BR _POSIX_THREAD_PRIORITY_SCHEDULING )
928 .SS TRACING - --- - ---
929 This option implies that the following options
930 are all defined to 200112L:
936 .B _POSIX_TRACE_EVENT_FILTER
940 .B _POSIX_TRACE_INHERIT
942 .SS STREAMS - _XOPEN_STREAMS - _SC_XOPEN_STREAMS
943 The following functions are present:
957 .SS XSI - _XOPEN_LEGACY - _SC_XOPEN_LEGACY
958 Functions included in the legacy option group were previously mandatory,
959 but are now optional in this version.
960 The following functions are present:
979 .SS XSI - _XOPEN_UNIX - _SC_XOPEN_UNIX
980 The following functions are present:
990 This option implies the following options:
996 .B _POSIX_MAPPED_FILES
998 .B _POSIX_MEMORY_PROTECTION
1000 .B _POSIX_THREAD_ATTR_STACKADDR
1002 .B _POSIX_THREAD_ATTR_STACKSIZE
1004 .B _POSIX_THREAD_PROCESS_SHARED
1006 .B _POSIX_THREAD_SAFE_FUNCTIONS
1011 This option may imply the following options from the XSI option groups:
1015 .RB "Encryption (" _XOPEN_CRYPT )
1017 .RB "Realtime (" _XOPEN_REALTIME )
1019 .RB "Advanced Realtime (" ADB )
1021 .RB "Realtime Threads (" _XOPEN_REALTIME_THREADS )
1023 .RB "Advanced Realtime Threads (" "ADVANCED REALTIME THREADS" )
1025 .RB "Tracing (" TRACING )
1027 .RB "XSI Streams (" STREAMS )
1029 .RB "Legacy (" _XOPEN_LEGACY )