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 2007-12-21 "" "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:
55 .IR posix_fallocate (),
56 .IR posix_memalign (),
61 .SS AIO - _POSIX_ASYNCHRONOUS_IO - _SC_ASYNCHRONOUS_IO
65 The following functions are present:
81 .SS BAR - _POSIX_BARRIERS - _SC_BARRIERS
82 This option implies the
85 .B _POSIX_THREAD_SAFE_FUNCTIONS
87 The following functions are present:
92 .IR pthread_barrier_destroy (),
93 .IR pthread_barrier_init (),
94 .IR pthread_barrier_wait (),
95 .IR pthread_barrierattr_destroy (),
96 .IR pthread_barrierattr_init ().
101 .\" Batch environment.
104 .SS --- - POSIX_CHOWN_RESTRICTED
105 If this option is in effect (as it always is under POSIX.1-2001),
106 then only root may change the owner of a file, and nonroot can
107 set the group of a file only to one of the groups it belongs to.
108 This affects the functions
111 .\" What about lchown() ?
112 .SS CS - _POSIX_CLOCK_SELECTION - _SC_CLOCK_SELECTION
113 This option implies the
116 The following functions are present:
121 .IR pthread_condattr_getclock (),
122 .IR pthread_condattr_setclock (),
123 .IR clock_nanosleep ().
129 is changed by the function
130 .IR clock_settime (),
131 then this affects all timers set for an absolute time.
132 .SS CPT - _POSIX_CPUTIME - _SC_CPUTIME
133 The clockID CLOCK_PROCESS_CPUTIME_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:
171 .SS MF - _POSIX_MAPPED_FILES - _SC_MAPPED_FILES
172 Shared memory is supported.
176 The following functions are present:
180 .SS ML - _POSIX_MEMLOCK - _SC_MEMLOCK
181 Shared memory can be locked into core.
186 .SS MR/MLR - _POSIX_MEMLOCK_RANGE - _SC_MEMLOCK_RANGE
187 More precisely, ranges can be locked into core.
192 .SS MPR - _POSIX_MEMORY_PROTECTION - _SC_MEMORY_PROTECTION
196 .SS MSG - _POSIX_MESSAGE_PASSING - _SC_MESSAGE_PASSING
200 The following functions are present:
216 .SS MON - _POSIX_MONOTONIC_CLOCK - _SC_MONOTONIC_CLOCK
219 This option implies the
222 Affected functions are
228 .IR clock_gettime (),
229 .IR clock_settime (),
233 .SS --- - _POSIX_MULTI_PROCESS - _SC_MULTI_PROCESS
234 This option has been deleted.
237 .\" IEC 60559 Floating-Point Option.
238 .SS --- - _POSIX_NO_TRUNC
239 If this option is in effect (as it always is under POSIX.1-2001)
240 then pathname components longer than
244 This property may be dependent on the path prefix of the component.
245 .SS PIO - _POSIX_PRIORITIZED_IO - _SC_PRIORITIZED_IO
246 This option says that one can specify priorities for asynchronous I/O.
247 This affects the functions
256 .SS PS - _POSIX_PRIORITY_SCHEDULING - _SC_PRIORITY_SCHEDULING
260 The following functions are present:
265 .IR sched_get_priority_max (),
266 .IR sched_get_priority_min (),
267 .IR sched_getparam (),
268 .IR sched_getscheduler (),
269 .IR sched_rr_get_interval (),
270 .IR sched_setparam (),
271 .IR sched_setscheduler (),
278 is in effect, then the following functions are present:
283 .IR posix_spawnattr_getschedparam (),
284 .IR posix_spawnattr_getschedpolicy (),
285 .IR posix_spawnattr_setschedparam (),
286 .IR posix_spawnattr_setschedpolicy ().
289 .SS RS - _POSIX_RAW_SOCKETS
290 Raw sockets are supported.
291 Affected functions are
294 .SS --- - _POSIX_READER_WRITER_LOCKS - _SC_READER_WRITER_LOCKS
295 This option implies the
299 under POSIX.1-2001 the
301 option implies this option.
303 The following functions are present:
306 .IR pthread_rwlock_destroy (),
307 .IR pthread_rwlock_init (),
308 .IR pthread_rwlock_rdlock (),
309 .IR pthread_rwlock_tryrdlock (),
310 .IR pthread_rwlock_trywrlock (),
311 .IR pthread_rwlock_unlock (),
312 .IR pthread_rwlock_wrlock (),
313 .IR pthread_rwlockattr_destroy (),
314 .IR pthread_rwlockattr_init ().
317 .SS RTS - _POSIX_REALTIME_SIGNALS - _SC_REALTIME_SIGNALS
318 Realtime signals are supported.
319 The following functions are present:
330 .SS --- - _POSIX_REGEXP - _SC_REGEXP
331 If this option is in effect (as it always is under POSIX.1-2001)
332 then POSIX regular expressions are supported
333 and the following functions are present:
345 .SS --- - _POSIX_SAVED_IDS - _SC_SAVED_IDS
346 If this option is in effect (as it always is under POSIX.1-2001),
347 then a process has a saved set-user-ID and a saved set-group-ID.
348 Affected functions are
363 .\" Software development
364 .SS SEM - _POSIX_SEMAPHORES - _SC_SEMAPHORES
368 The following functions are present:
385 .SS SHM - _POSIX_SHARED_MEMORY_OBJECTS - _SC_SHARED_MEMORY_OBJECTS
386 The following functions are present:
398 .SS --- - _POSIX_SHELL - _SC_SHELL
399 If this option is in effect (as it always is under POSIX.1-2001),
403 .SS SPN - _POSIX_SPAWN - _SC_SPAWN
404 This option describes support for process creation in a context where
405 it is difficult or impossible to use
407 for example, because no MMU is present.
410 is in effect, then the include file
412 and the following functions are present:
418 .IR posix_spawn_file_actions_addclose (),
419 .IR posix_spawn_file_actions_adddup2 (),
420 .IR posix_spawn_file_actions_addopen (),
421 .IR posix_spawn_file_actions_destroy (),
422 .IR posix_spawn_file_actions_init (),
423 .IR posix_spawnattr_destroy (),
424 .IR posix_spawnattr_getsigdefault (),
425 .IR posix_spawnattr_getflags (),
426 .IR posix_spawnattr_getpgroup (),
427 .IR posix_spawnattr_getsigmask (),
428 .IR posix_spawnattr_init (),
429 .IR posix_spawnattr_setsigdefault (),
430 .IR posix_spawnattr_setflags (),
431 .IR posix_spawnattr_setpgroup (),
432 .IR posix_spawnattr_setsigmask (),
438 .B _POSIX_PRIORITY_SCHEDULING
440 the following functions are present:
445 .IR posix_spawnattr_getschedparam (),
446 .IR posix_spawnattr_getschedpolicy (),
447 .IR posix_spawnattr_setschedparam (),
448 .IR posix_spawnattr_setschedpolicy ().
451 .SS SPI - _POSIX_SPIN_LOCKS - _SC_SPIN_LOCKS
452 This option implies the
455 .B _POSIX_THREAD_SAFE_FUNCTIONS
457 The following functions are present:
462 .IR pthread_spin_destroy (),
463 .IR pthread_spin_init (),
464 .IR pthread_spin_lock (),
465 .IR pthread_spin_trylock (),
466 .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 Affected functions are
482 .IR sched_setparam (),
483 .IR sched_setscheduler ().
487 .SS SIO - _POSIX_SYNCHRONIZED_IO - _SC_SYNCHRONIZED_IO
488 Affected functions are
493 .SS TSA - _POSIX_THREAD_ATTR_STACKADDR - _SC_THREAD_ATTR_STACKADDR
494 Affected functions are
499 .IR pthread_attr_getstack (),
500 .IR pthread_attr_getstackaddr (),
501 .IR pthread_attr_setstack (),
502 .IR pthread_attr_setstackaddr ().
506 .SS TSS - _POSIX_THREAD_ATTR_STACKSIZE - _SC_THREAD_ATTR_STACKSIZE
507 Affected functions are
512 .IR pthread_attr_getstack (),
513 .IR pthread_attr_getstacksize (),
514 .IR pthread_attr_setstack (),
515 .IR pthread_attr_setstacksize ().
519 .SS TCT - _POSIX_THREAD_CPUTIME - _SC_THREAD_CPUTIME
520 The clockID CLOCK_THREAD_CPUTIME_ID is supported.
521 This option implies the
524 Affected functions are
529 .IR pthread_getcpuclockid (),
531 .IR clock_gettime (),
532 .IR clock_settime (),
537 .SS TPI - _POSIX_THREAD_PRIO_INHERIT - _SC_THREAD_PRIO_INHERIT
538 Affected functions are
543 .IR pthread_mutexattr_getprotocol (),
544 .IR pthread_mutexattr_setprotocol ().
548 .SS TPP - _POSIX_THREAD_PRIO_PROTECT - _SC_THREAD_PRIO_PROTECT
549 Affected functions are
554 .IR pthread_mutex_getprioceiling (),
555 .IR pthread_mutex_setprioceiling (),
556 .IR pthread_mutexattr_getprioceiling (),
557 .IR pthread_mutexattr_getprotocol (),
558 .IR pthread_mutexattr_setprioceiling (),
559 .IR pthread_mutexattr_setprotocol ().
563 .SS TPS - _POSIX_THREAD_PRIORITY_SCHEDULING - _SC_THREAD_PRIORITY_SCHEDULING
564 If this option is in effect, the different threads inside a process
565 can run with different priorities and/or different schedulers.
566 Affected functions are
571 .IR pthread_attr_getinheritsched (),
572 .IR pthread_attr_getschedpolicy (),
573 .IR pthread_attr_getscope (),
574 .IR pthread_attr_setinheritsched (),
575 .IR pthread_attr_setschedpolicy (),
576 .IR pthread_attr_setscope (),
577 .IR pthread_getschedparam (),
578 .IR pthread_setschedparam (),
579 .IR pthread_setschedprio ().
583 .SS TSH - _POSIX_THREAD_PROCESS_SHARED - _SC_THREAD_PROCESS_SHARED
584 Affected functions are
589 .IR pthread_barrierattr_getpshared (),
590 .IR pthread_barrierattr_setpshared (),
591 .IR pthread_condattr_getpshared (),
592 .IR pthread_condattr_setpshared (),
593 .IR pthread_mutexattr_getpshared (),
594 .IR pthread_mutexattr_setpshared (),
595 .IR pthread_rwlockattr_getpshared (),
596 .IR pthread_rwlockattr_setpshared ().
600 .SS TSF - _POSIX_THREAD_SAFE_FUNCTIONS - _SC_THREAD_SAFE_FUNCTIONS
601 Affected functions are
614 .IR getc_unlocked (),
615 .IR getchar_unlocked (),
616 .IR putc_unlocked (),
617 .IR putchar_unlocked (),
628 .SS TSP - _POSIX_THREAD_SPORADIC_SERVER - _SC_THREAD_SPORADIC_SERVER
629 This option implies the
630 .B _POSIX_THREAD_PRIORITY_SCHEDULING
632 Affected functions are
637 .IR sched_getparam (),
638 .IR sched_setparam (),
639 .IR sched_setscheduler ().
643 .SS THR - _POSIX_THREADS - _SC_THREADS
644 Basic support for POSIX threads is available.
645 The following functions are present:
650 .IR pthread_atfork (),
651 .IR pthread_attr_destroy (),
652 .IR pthread_attr_getdetachstate (),
653 .IR pthread_attr_getschedparam (),
654 .IR pthread_attr_init (),
655 .IR pthread_attr_setdetachstate (),
656 .IR pthread_attr_setschedparam (),
657 .IR pthread_cancel (),
658 .IR pthread_cleanup_push (),
659 .IR pthread_cleanup_pop (),
660 .IR pthread_cond_broadcast (),
661 .IR pthread_cond_destroy (),
662 .IR pthread_cond_init (),
663 .IR pthread_cond_signal (),
664 .IR pthread_cond_timedwait (),
665 .IR pthread_cond_wait (),
666 .IR pthread_condattr_destroy (),
667 .IR pthread_condattr_init (),
668 .IR pthread_create (),
669 .IR pthread_detach (),
670 .IR pthread_equal (),
672 .IR pthread_getspecific (),
674 .IR pthread_key_create (),
675 .IR pthread_key_delete (),
676 .IR pthread_mutex_destroy (),
677 .IR pthread_mutex_init (),
678 .IR pthread_mutex_lock (),
679 .IR pthread_mutex_trylock (),
680 .IR pthread_mutex_unlock (),
681 .IR pthread_mutexattr_destroy (),
682 .IR pthread_mutexattr_init (),
684 .IR pthread_rwlock_destroy (),
685 .IR pthread_rwlock_init (),
686 .IR pthread_rwlock_rdlock (),
687 .IR pthread_rwlock_tryrdlock (),
688 .IR pthread_rwlock_trywrlock (),
689 .IR pthread_rwlock_unlock (),
690 .IR pthread_rwlock_wrlock (),
691 .IR pthread_rwlockattr_destroy (),
692 .IR pthread_rwlockattr_init (),
694 .IR pthread_setcancelstate (),
695 .IR pthread_setcanceltype (),
696 .IR pthread_setspecific (),
697 .IR pthread_testcancel ().
701 .SS TMO - _POSIX_TIMEOUTS - _SC_TIMEOUTS
702 The following functions are present:
707 .IR mq_timedreceive (),
709 .IR pthread_mutex_timedlock (),
710 .IR pthread_rwlock_timedrdlock (),
711 .IR pthread_rwlock_timedwrlock (),
712 .IR sem_timedwait (),
713 .IR posix_trace_timedgetnext_event ().
717 .SS TMR - _POSIX_TIMERS - _SC_TIMERS
718 The following functions are present:
724 .IR clock_gettime (),
725 .IR clock_settime (),
729 .IR timer_gettime (),
730 .IR timer_getoverrun (),
731 .IR timer_settime ().
735 .SS TRC - _POSIX_TRACE - _SC_TRACE
736 POSIX tracing is available.
737 The following functions are present:
742 .IR posix_trace_attr_destroy (),
743 .IR posix_trace_attr_getclockres (),
744 .IR posix_trace_attr_getcreatetime (),
745 .IR posix_trace_attr_getgenversion (),
746 .IR posix_trace_attr_getmaxdatasize (),
747 .IR posix_trace_attr_getmaxsystemeventsize (),
748 .IR posix_trace_attr_getmaxusereventsize (),
749 .IR posix_trace_attr_getname (),
750 .IR posix_trace_attr_getstreamfullpolicy (),
751 .IR posix_trace_attr_getstreamsize (),
752 .IR posix_trace_attr_init (),
753 .IR posix_trace_attr_setmaxdatasize (),
754 .IR posix_trace_attr_setname (),
755 .IR posix_trace_attr_setstreamsize (),
756 .IR posix_trace_attr_setstreamfullpolicy (),
757 .IR posix_trace_clear (),
758 .IR posix_trace_create (),
759 .IR posix_trace_event (),
760 .IR posix_trace_eventid_equal (),
761 .IR posix_trace_eventid_get_name (),
762 .IR posix_trace_eventid_open (),
763 .IR posix_trace_eventtypelist_getnext_id (),
764 .IR posix_trace_eventtypelist_rewind (),
765 .IR posix_trace_flush (),
766 .IR posix_trace_get_attr (),
767 .IR posix_trace_get_status (),
768 .IR posix_trace_getnext_event (),
769 .IR posix_trace_shutdown (),
770 .IR posix_trace_start (),
771 .IR posix_trace_stop (),
772 .IR posix_trace_trygetnext_event ().
776 .SS TEF - _POSIX_TRACE_EVENT_FILTER - _SC_TRACE_EVENT_FILTER
777 This option implies the
780 The following functions are present:
785 .IR posix_trace_eventset_add (),
786 .IR posix_trace_eventset_del (),
787 .IR posix_trace_eventset_empty (),
788 .IR posix_trace_eventset_fill (),
789 .IR posix_trace_eventset_ismember (),
790 .IR posix_trace_get_filter (),
791 .IR posix_trace_set_filter (),
792 .IR posix_trace_trid_eventid_open ().
796 .SS TRI - _POSIX_TRACE_INHERIT - _SC_TRACE_INHERIT
797 Tracing children of the traced process is supported.
798 This option implies the
801 The following functions are present:
806 .IR posix_trace_attr_getinherited (),
807 .IR posix_trace_attr_setinherited ().
811 .SS TRL - _POSIX_TRACE_LOG - _SC_TRACE_LOG
812 This option implies the
815 The following functions are present:
820 .IR posix_trace_attr_getlogfullpolicy (),
821 .IR posix_trace_attr_getlogsize (),
822 .IR posix_trace_attr_setlogfullpolicy (),
823 .IR posix_trace_attr_setlogsize (),
824 .IR posix_trace_close (),
825 .IR posix_trace_create_withlog (),
826 .IR posix_trace_open (),
827 .IR posix_trace_rewind ().
831 .SS TYM - _POSIX_TYPED_MEMORY_OBJECTS - _SC_TYPED_MEMORY_OBJECT
832 The following functions are present:
837 .IR posix_mem_offset (),
838 .IR posix_typed_mem_get_info (),
839 .IR posix_typed_mem_open ().
843 .SS --- - _POSIX_VDISABLE
844 Always present (probably 0).
845 Value to set a changeable special control
846 character to indicate that it is disabled.
850 .BR _XOPEN_REALTIME ,
851 .BR _XOPEN_REALTIME_THREADS ,