1POSIX Option and Option Group Details
2#####################################
3
4.. _posix_option_groups:
5
6POSIX Option Groups
7===================
8
9.. _posix_option_group_barriers:
10
11POSIX_BARRIERS
12++++++++++++++
13
14Enable this option group with :kconfig:option:`CONFIG_POSIX_BARRIERS`.
15
16.. csv-table:: POSIX_BARRIERS
17   :header: API, Supported
18   :widths: 50,10
19
20    pthread_barrier_destroy(),yes
21    pthread_barrier_init(),yes
22    pthread_barrier_wait(),yes
23    pthread_barrierattr_destroy(),yes
24    pthread_barrierattr_init(),yes
25
26.. _posix_option_group_c_lang_jump:
27
28POSIX_C_LANG_JUMP
29+++++++++++++++++
30
31The ``POSIX_C_LANG_JUMP`` Option Group is included in the ISO C standard.
32
33.. note::
34   When using Newlib, Picolibc, or other C libraries conforming to the ISO C Standard, the
35   ``POSIX_C_LANG_JUMP`` Option Group is considered supported.
36
37.. csv-table:: POSIX_C_LANG_JUMP
38   :header: API, Supported
39   :widths: 50,10
40
41    setjmp(), yes
42    longjmp(), yes
43
44.. _posix_option_group_c_lang_math:
45
46POSIX_C_LANG_MATH
47+++++++++++++++++
48
49The ``POSIX_C_LANG_MATH`` Option Group is included in the ISO C standard.
50
51.. note::
52   When using Newlib, Picolibc, or other C libraries conforming to the ISO C Standard, the
53   ``POSIX_C_LANG_MATH`` Option Group is considered supported.
54
55Please refer to `Subprofiling Considerations`_ for details on the ``POSIX_C_LANG_MATH`` Option
56Group.
57
58.. _posix_option_group_c_lang_support:
59
60POSIX_C_LANG_SUPPORT
61++++++++++++++++++++
62
63The POSIX_C_LANG_SUPPORT option group contains the general ISO C Library.
64
65.. note::
66   When using Newlib, Picolibc, or other C libraries conforming to the ISO C Standard, the entire
67   ``POSIX_C_LANG_SUPPORT`` Option Group is considered supported.
68
69Please refer to `Subprofiling Considerations`_ for details on the ``POSIX_C_LANG_SUPPORT`` Option
70Group.
71
72For more information on developing Zephyr applications in the C programming language, please refer
73to :ref:`details<language_support>`.
74
75.. _posix_option_group_c_lib_ext:
76
77POSIX_C_LIB_EXT
78+++++++++++++++
79
80Enable this option group with :kconfig:option:`CONFIG_POSIX_C_LIB_EXT`.
81
82.. csv-table:: POSIX_C_LIB_EXT
83   :header: API, Supported
84   :widths: 50,10
85
86    fnmatch(), yes
87    getopt(), yes
88    getsubopt(),
89    optarg, yes
90    opterr, yes
91    optind, yes
92    optopt, yes
93    stpcpy(),
94    stpncpy(),
95    strcasecmp(),
96    strdup(),
97    strfmon(),
98    strncasecmp(), yes
99    strndup(),
100    strnlen(), yes
101
102.. _posix_option_group_clock_selection:
103
104POSIX_CLOCK_SELECTION
105+++++++++++++++++++++
106
107Enable this option group with :kconfig:option:`CONFIG_POSIX_CLOCK_SELECTION`.
108
109.. csv-table:: POSIX_CLOCK_SELECTION
110   :header: API, Supported
111   :widths: 50,10
112
113    pthread_condattr_getclock(),yes
114    pthread_condattr_setclock(),yes
115    clock_nanosleep(),yes
116
117.. _posix_option_group_device_io:
118
119POSIX_DEVICE_IO
120+++++++++++++++
121
122Enable this option group with :kconfig:option:`CONFIG_POSIX_DEVICE_IO`.
123
124.. note::
125   When using Newlib, Picolibc, or other C libraries conforming to the ISO C Standard, the
126   C89 components of the ``POSIX_DEVICE_IO`` Option Group are considered supported.
127
128.. csv-table:: POSIX_DEVICE_IO
129   :header: API, Supported
130   :widths: 50,10
131
132    FD_CLR(),yes
133    FD_ISSET(),yes
134    FD_SET(),yes
135    FD_ZERO(),yes
136    clearerr(),yes
137    close(),yes
138    fclose(),yes
139    fdopen(),yes
140    feof(),yes
141    ferror(),yes
142    fflush(),yes
143    fgetc(),yes
144    fgets(),yes
145    fileno(),yes
146    fopen(),yes
147    fprintf(),yes
148    fputc(),yes
149    fputs(),yes
150    fread(),yes
151    freopen(),yes
152    fscanf(),yes
153    fwrite(),yes
154    getc(),yes
155    getchar(),yes
156    gets(),yes
157    open(),yes
158    perror(),yes
159    poll(),yes
160    printf(),yes
161    pread(),yes
162    pselect(),yes
163    putc(),yes
164    putchar(),yes
165    puts(),yes
166    pwrite(),yes
167    read(),yes
168    scanf(),yes
169    select(),yes
170    setbuf(),yes
171    setvbuf(),yes
172    stderr,yes
173    stdin,yes
174    stdout,yes
175    ungetc(),yes
176    vfprintf(),yes
177    vfscanf(),yes
178    vprintf(),yes
179    vscanf(),yes
180    write(),yes
181
182.. _posix_option_group_fd_mgmt:
183
184POSIX_FD_MGMT
185+++++++++++++
186
187Enable this option group with :kconfig:option:`CONFIG_POSIX_FD_MGMT`.
188
189.. csv-table:: POSIX_FD_MGMT
190   :header: API, Supported
191   :widths: 50,10
192
193    dup(),
194    dup2(),
195    fcntl(),
196    fgetpos(),
197    fseek(),
198    fseeko(),
199    fsetpos(),
200    ftell(),
201    ftello(),
202    ftruncate(),yes
203    lseek(),
204    rewind(),
205
206.. _posix_option_group_file_locking:
207
208POSIX_FILE_LOCKING
209++++++++++++++++++
210
211.. csv-table:: POSIX_FILE_LOCKING
212   :header: API, Supported
213   :widths: 50,10
214
215    flockfile(),
216    ftrylockfile(),
217    funlockfile(),
218    getc_unlocked(),
219    getchar_unlocked(),
220    putc_unlocked(),
221    putchar_unlocked(),
222
223.. _posix_option_group_file_system:
224
225POSIX_FILE_SYSTEM
226+++++++++++++++++
227
228Enable this option group with :kconfig:option:`CONFIG_POSIX_FILE_SYSTEM`.
229
230.. csv-table:: POSIX_FILE_SYSTEM
231   :header: API, Supported
232   :widths: 50,10
233
234    access(),
235    chdir(),
236    closedir(), yes
237    creat(),
238    fchdir(),
239    fpathconf(),
240    fstat(), yes
241    fstatvfs(),
242    getcwd(),
243    link(),
244    mkdir(), yes
245    mkstemp(),
246    opendir(), yes
247    pathconf(),
248    readdir(), yes
249    remove(), yes
250    rename(), yes
251    rewinddir(),
252    rmdir(), yes
253    stat(), yes
254    statvfs(),
255    tmpfile(),
256    tmpnam(),
257    truncate(),
258    unlink(), yes
259    utime(),
260
261.. _posix_option_group_file_system_r:
262
263POSIX_FILE_SYSTEM_R
264+++++++++++++++++++
265
266Enable this option with :kconfig:option:`CONFIG_POSIX_FILE_SYSTEM_R`.
267
268.. csv-table:: POSIX_FILE_SYSTEM_R
269   :header: API, Supported
270   :widths: 50,10
271
272    readdir_r(), yes
273
274.. _posix_option_group_mapped_files:
275
276POSIX_MAPPED_FILES
277++++++++++++++++++
278
279Enable this option group with :kconfig:option:`CONFIG_POSIX_MAPPED_FILES`.
280
281.. csv-table:: POSIX_MAPPED_FILES
282   :header: API, Supported
283   :widths: 50,10
284
285    mmap(),yes
286    msync(),yes
287    munmap(),yes
288
289.. _posix_option_group_memory_protection:
290
291POSIX_MEMORY_PROTECTION
292+++++++++++++++++++++++
293
294Enable this option group with :kconfig:option:`CONFIG_POSIX_MEMORY_PROTECTION`.
295
296.. csv-table:: POSIX_MEMORY_PROTECTION
297   :header: API, Supported
298   :widths: 50,10
299
300    mprotect(), yes :ref:`†<posix_undefined_behaviour>`
301
302.. _posix_option_group_multi_process:
303
304POSIX_MULTI_PROCESS
305+++++++++++++++++++
306
307Enable this option group with :kconfig:option:`CONFIG_POSIX_MULTI_PROCESS`.
308
309.. csv-table:: POSIX_MULTI_PROCESS
310   :header: API, Supported
311   :widths: 50,10
312
313    _Exit(), yes
314    _exit(), yes
315    assert(), yes
316    atexit(),:ref:`†<posix_undefined_behaviour>`
317    clock(),
318    execl(),:ref:`†<posix_undefined_behaviour>`
319    execle(),:ref:`†<posix_undefined_behaviour>`
320    execlp(),:ref:`†<posix_undefined_behaviour>`
321    execv(),:ref:`†<posix_undefined_behaviour>`
322    execve(),:ref:`†<posix_undefined_behaviour>`
323    execvp(),:ref:`†<posix_undefined_behaviour>`
324    exit(), yes
325    fork(),:ref:`†<posix_undefined_behaviour>`
326    getpgrp(),:ref:`†<posix_undefined_behaviour>`
327    getpgid(),:ref:`†<posix_undefined_behaviour>`
328    getpid(), yes :ref:`†<posix_undefined_behaviour>`
329    getppid(),:ref:`†<posix_undefined_behaviour>`
330    getsid(),:ref:`†<posix_undefined_behaviour>`
331    setsid(),:ref:`†<posix_undefined_behaviour>`
332    sleep(),yes
333    times(),
334    wait(),:ref:`†<posix_undefined_behaviour>`
335    waitid(),:ref:`†<posix_undefined_behaviour>`
336    waitpid(),:ref:`†<posix_undefined_behaviour>`
337
338.. _posix_option_group_networking:
339
340POSIX_NETWORKING
341++++++++++++++++
342
343The function ``sockatmark()`` is not yet supported and is expected to fail setting ``errno``
344to ``ENOSYS`` :ref:`†<posix_undefined_behaviour>`.
345
346Enable this option group with :kconfig:option:`CONFIG_POSIX_NETWORKING`.
347
348.. csv-table:: POSIX_NETWORKING
349   :header: API, Supported
350   :widths: 50,10
351
352    accept(),yes
353    bind(),yes
354    connect(),yes
355    endhostent(),yes
356    endnetent(),yes
357    endprotoent(),yes
358    endservent(),yes
359    freeaddrinfo(),yes
360    gai_strerror(),yes
361    getaddrinfo(),yes
362    gethostent(),yes
363    gethostname(),yes
364    getnameinfo(),yes
365    getnetbyaddr(),yes
366    getnetbyname(),yes
367    getnetent(),yes
368    getpeername(),yes
369    getprotobyname(),yes
370    getprotobynumber(),yes
371    getprotoent(),yes
372    getservbyname(),yes
373    getservbyport(),yes
374    getservent(),yes
375    getsockname(),yes
376    getsockopt(),yes
377    htonl(),yes
378    htons(),yes
379    if_freenameindex(),yes
380    if_indextoname(),yes
381    if_nameindex(),yes
382    if_nametoindex(),yes
383    inet_addr(),yes
384    inet_ntoa(),yes
385    inet_ntop(),yes
386    inet_pton(),yes
387    listen(),yes
388    ntohl(),yes
389    ntohs(),yes
390    recv(),yes
391    recvfrom(),yes
392    recvmsg(),yes
393    send(),yes
394    sendmsg(),yes
395    sendto(),yes
396    sethostent(),yes
397    setnetent(),yes
398    setprotoent(),yes
399    setservent(),yes
400    setsockopt(),yes
401    shutdown(),yes
402    socket(),yes
403    sockatmark(),yes :ref:`†<posix_undefined_behaviour>`
404    socketpair(),yes
405
406.. _posix_option_group_pipe:
407
408POSIX_PIPE
409++++++++++
410
411.. csv-table:: POSIX_PIPE
412   :header: API, Supported
413   :widths: 50,10
414
415    pipe(),
416
417.. _posix_option_group_realtime_signals:
418
419POSIX_REALTIME_SIGNALS
420++++++++++++++++++++++
421
422Enable this option group with :kconfig:option:`CONFIG_POSIX_REALTIME_SIGNALS`.
423
424.. csv-table:: POSIX_REALTIME_SIGNALS
425   :header: API, Supported
426   :widths: 50,10
427
428    sigqueue(),
429    sigtimedwait(),
430    sigwaitinfo(),
431
432.. _posix_option_group_semaphores:
433
434POSIX_SEMAPHORES
435++++++++++++++++
436
437Enable this option group with :kconfig:option:`CONFIG_POSIX_SEMAPHORES`.
438
439.. csv-table:: POSIX_SEMAPHORES
440   :header: API, Supported
441   :widths: 50,10
442
443    sem_close(),yes
444    sem_destroy(),yes
445    sem_getvalue(),yes
446    sem_init(),yes
447    sem_open(),yes
448    sem_post(),yes
449    sem_trywait(),yes
450    sem_unlink(),yes
451    sem_wait(),yes
452
453.. _posix_option_group_signal_jump:
454
455POSIX_SIGNAL_JUMP
456+++++++++++++++++
457
458.. csv-table:: POSIX_SIGNAL_JUMP
459   :header: API, Supported
460   :widths: 50,10
461
462    siglongjmp(),
463    sigsetjmp(),
464
465.. _posix_option_group_signals:
466
467POSIX_SIGNALS
468+++++++++++++
469
470Enable this option group with :kconfig:option:`CONFIG_POSIX_SIGNALS`.
471
472.. note::
473   As processes are not yet supported in Zephyr, the ISO C functions ``abort()``, ``signal()``,
474   and ``raise()``, as well as the other POSIX functions listed below, may exhibit undefined
475   behaviour. The POSIX functions ``kill()``, ``pause()``, ``sigaction()``, ``sigpending()``,
476   ``sigsuspend()``, and ``sigwait()`` are implemented to ensure that conformant applications can
477   link, but they are expected to fail, setting errno to ``ENOSYS``
478   :ref:`†<posix_undefined_behaviour>`.
479
480.. csv-table:: POSIX_SIGNALS
481   :header: API, Supported
482   :widths: 50,10
483
484    abort(),yes :ref:`†<posix_undefined_behaviour>`
485    alarm(),yes :ref:`†<posix_undefined_behaviour>`
486    kill(),yes :ref:`†<posix_undefined_behaviour>`
487    pause(),yes :ref:`†<posix_undefined_behaviour>`
488    raise(),yes :ref:`†<posix_undefined_behaviour>`
489    sigaction(),yes :ref:`†<posix_undefined_behaviour>`
490    sigaddset(),yes
491    sigdelset(),yes
492    sigemptyset(),yes
493    sigfillset(),yes
494    sigismember(),yes
495    signal(),yes :ref:`†<posix_undefined_behaviour>`
496    sigpending(),yes :ref:`†<posix_undefined_behaviour>`
497    sigprocmask(),yes
498    sigsuspend(),yes :ref:`†<posix_undefined_behaviour>`
499    sigwait(),yes :ref:`†<posix_undefined_behaviour>`
500    strsignal(),yes
501
502.. _posix_option_group_single_process:
503
504POSIX_SINGLE_PROCESS
505++++++++++++++++++++
506
507The POSIX_SINGLE_PROCESS option group contains services for single
508process applications.
509
510Enable this option group with :kconfig:option:`CONFIG_POSIX_SINGLE_PROCESS`.
511
512.. csv-table:: POSIX_SINGLE_PROCESS
513   :header: API, Supported
514   :widths: 50,10
515
516    confstr(),yes
517    environ,yes
518    errno,yes
519    getenv(),yes
520    setenv(),yes
521    sysconf(),yes
522    uname(),yes
523    unsetenv(),yes
524
525.. _posix_option_group_spin_locks:
526
527POSIX_SPIN_LOCKS
528++++++++++++++++
529
530Enable this option group with :kconfig:option:`CONFIG_POSIX_SPIN_LOCKS`.
531
532.. csv-table:: POSIX_SPIN_LOCKS
533   :header: API, Supported
534   :widths: 50,10
535
536    pthread_spin_destroy(),yes
537    pthread_spin_init(),yes
538    pthread_spin_lock(),yes
539    pthread_spin_trylock(),yes
540    pthread_spin_unlock(),yes
541
542.. _posix_option_group_threads_base:
543
544POSIX_THREADS_BASE
545++++++++++++++++++
546
547The basic assumption in this profile is that the system
548consists of a single (implicit) process with multiple threads. Therefore, the
549standard requires all basic thread services, except those related to
550multiple processes.
551
552Enable this option group with :kconfig:option:`CONFIG_POSIX_THREADS`.
553
554.. csv-table:: POSIX_THREADS_BASE
555   :header: API, Supported
556   :widths: 50,10
557
558    pthread_atfork(),yes
559    pthread_attr_destroy(),yes
560    pthread_attr_getdetachstate(),yes
561    pthread_attr_getschedparam(),yes
562    pthread_attr_init(),yes
563    pthread_attr_setdetachstate(),yes
564    pthread_attr_setschedparam(),yes
565    pthread_barrier_destroy(),yes
566    pthread_barrier_init(),yes
567    pthread_barrier_wait(),yes
568    pthread_barrierattr_destroy(),yes
569    pthread_barrierattr_getpshared(),yes
570    pthread_barrierattr_init(),yes
571    pthread_barrierattr_setpshared(),yes
572    pthread_cancel(),yes
573    pthread_cleanup_pop(),yes
574    pthread_cleanup_push(),yes
575    pthread_cond_broadcast(),yes
576    pthread_cond_destroy(),yes
577    pthread_cond_init(),yes
578    pthread_cond_signal(),yes
579    pthread_cond_timedwait(),yes
580    pthread_cond_wait(),yes
581    pthread_condattr_destroy(),yes
582    pthread_condattr_init(),yes
583    pthread_create(),yes
584    pthread_detach(),yes
585    pthread_equal(),yes
586    pthread_exit(),yes
587    pthread_getspecific(),yes
588    pthread_join(),yes
589    pthread_key_create(),yes
590    pthread_key_delete(),yes
591    pthread_kill(),
592    pthread_mutex_destroy(),yes
593    pthread_mutex_init(),yes
594    pthread_mutex_lock(),yes
595    pthread_mutex_trylock(),yes
596    pthread_mutex_unlock(),yes
597    pthread_mutexattr_destroy(),yes
598    pthread_mutexattr_init(),yes
599    pthread_once(),yes
600    pthread_self(),yes
601    pthread_setcancelstate(),yes
602    pthread_setcanceltype(),yes
603    pthread_setspecific(),yes
604    pthread_sigmask(),yes
605    pthread_testcancel(),yes
606
607.. _posix_option_group_posix_threads_ext:
608
609POSIX_THREADS_EXT
610+++++++++++++++++
611
612Enable this option group with :kconfig:option:`CONFIG_POSIX_THREADS_EXT`.
613
614.. csv-table:: POSIX_THREADS_EXT
615   :header: API, Supported
616   :widths: 50,10
617
618    pthread_attr_getguardsize(),yes
619    pthread_attr_setguardsize(),yes
620    pthread_mutexattr_gettype(),yes
621    pthread_mutexattr_settype(),yes
622
623.. _posix_option_group_timers:
624
625POSIX_TIMERS
626++++++++++++
627
628Enable this option group with :kconfig:option:`CONFIG_POSIX_TIMERS`.
629
630.. csv-table:: POSIX_TIMERS
631   :header: API, Supported
632   :widths: 50,10
633
634    clock_getres(),yes
635    clock_gettime(),yes
636    clock_settime(),yes
637    nanosleep(),yes
638    timer_create(),yes
639    timer_delete(),yes
640    timer_gettime(),yes
641    timer_getoverrun(),yes
642    timer_settime(),yes
643
644.. _posix_option_group_xsi_realtime:
645
646XSI_REALTIME
647++++++++++++
648
649The ``XSI_REALTIME`` option group indicates that the :ref:`_POSIX_FSYNC<posix_option_fsync>`,
650:ref:`_POSIX_MEMLOCK<posix_option_memlock>`,
651:ref:`_POSIX_MEMLOCK_RANGE<posix_option_memlock_range>`,
652:ref:`_POSIX_MESSAGE_PASSING<posix_option_message_passing>`,
653:ref:`_POSIX_PRIORITY_SCHEDULING<posix_option_priority_scheduling>`,
654:ref:`_POSIX_SHARED_MEMORY_OBJECTS<posix_option_shared_memory_objects>`, and
655:ref:`_POSIX_SYNCHRONIZED_IO<posix_option_synchronized_io>` options are enabled.
656
657Enable this option group with :kconfig:option:`CONFIG_XSI_REALTIME`.
658
659When this option group is enabled, the ``_XOPEN_REALTIME`` feature test macro will be defined to a
660value other than -1.
661
662.. _posix_option_group_xsi_system_logging:
663
664XSI_SYSTEM_LOGGING
665++++++++++++++++++
666
667Enable this option group with :kconfig:option:`CONFIG_XSI_SYSTEM_LOGGING`.
668
669.. csv-table:: XSI_SYSTEM_LOGGING
670   :header: API, Supported
671   :widths: 50,10
672
673    closelog(),yes
674    openlog(),yes
675    setlogmask(),yes
676    syslog(),yes
677
678.. _posix_option_group_xsi_threads_ext:
679
680XSI_THREADS_EXT
681+++++++++++++++
682
683The XSI_THREADS_EXT option group is required because it provides
684functions to control a thread's stack. This is considered useful for any
685real-time application.
686
687Enable this option group with :kconfig:option:`CONFIG_XSI_THREADS_EXT`.
688
689.. csv-table:: XSI_THREADS_EXT
690   :header: API, Supported
691   :widths: 50,10
692
693    pthread_attr_getstack(),yes
694    pthread_attr_setstack(),yes
695    pthread_getconcurrency(),yes
696    pthread_setconcurrency(),yes
697
698.. _posix_options:
699
700POSIX Options
701=============
702
703.. _posix_option_asynchronous_io:
704
705_POSIX_ASYNCHRONOUS_IO
706++++++++++++++++++++++
707
708Functions part of the ``_POSIX_ASYNCHRONOUS_IO`` Option are not implemented in Zephyr but are
709provided so that conformant applications can still link. These functions will fail, setting
710``errno`` to ``ENOSYS``:ref:`†<posix_undefined_behaviour>`.
711
712Enable this option with :kconfig:option:`CONFIG_POSIX_ASYNCHRONOUS_IO`.
713
714.. csv-table:: _POSIX_ASYNCHRONOUS_IO
715   :header: API, Supported
716   :widths: 50,10
717
718    aio_cancel(),yes :ref:`†<posix_undefined_behaviour>`
719    aio_error(),yes :ref:`†<posix_undefined_behaviour>`
720    aio_fsync(),yes :ref:`†<posix_undefined_behaviour>`
721    aio_read(),yes :ref:`†<posix_undefined_behaviour>`
722    aio_return(),yes :ref:`†<posix_undefined_behaviour>`
723    aio_suspend(),yes :ref:`†<posix_undefined_behaviour>`
724    aio_write(),yes :ref:`†<posix_undefined_behaviour>`
725    lio_listio(),yes :ref:`†<posix_undefined_behaviour>`
726
727.. _posix_option_cputime:
728
729_POSIX_CPUTIME
730++++++++++++++
731
732Enable this option with :kconfig:option:`CONFIG_POSIX_CPUTIME`.
733
734.. csv-table:: _POSIX_CPUTIME
735   :header: API, Supported
736   :widths: 50,10
737
738    CLOCK_PROCESS_CPUTIME_ID,yes
739
740.. _posix_option_fsync:
741
742_POSIX_FSYNC
743++++++++++++
744
745Enable this option with :kconfig:option:`CONFIG_POSIX_FSYNC`.
746
747.. csv-table:: _POSIX_FSYNC
748   :header: API, Supported
749   :widths: 50,10
750
751    fsync(),yes
752
753.. _posix_option_ipv6:
754
755_POSIX_IPV6
756+++++++++++
757
758Internet Protocol Version 6 is supported.
759
760For more information, please refer to :ref:`Networking <networking>`.
761
762Enable this option with :kconfig:option:`CONFIG_POSIX_IPV6`.
763
764.. _posix_option_memlock:
765
766_POSIX_MEMLOCK
767++++++++++++++
768
769Zephyr's :ref:`Demand Paging API <memory_management_api_demand_paging>` does not yet support
770pinning or unpinning all virtual memory regions. The functions below are expected to fail and
771set ``errno`` to ``ENOSYS`` :ref:`†<posix_undefined_behaviour>`.
772
773Enable this option with :kconfig:option:`CONFIG_POSIX_MEMLOCK`.
774
775.. csv-table:: _POSIX_MEMLOCK
776   :header: API, Supported
777   :widths: 50,10
778
779    mlockall(), yes
780    munlockall(), yes
781
782.. _posix_option_memlock_range:
783
784_POSIX_MEMLOCK_RANGE
785++++++++++++++++++++
786
787Enable this option with :kconfig:option:`CONFIG_POSIX_MEMLOCK_RANGE`.
788
789.. csv-table:: _POSIX_MEMLOCK_RANGE
790   :header: API, Supported
791   :widths: 50,10
792
793    mlock(), yes
794    munlock(), yes
795
796.. _posix_option_message_passing:
797
798_POSIX_MESSAGE_PASSING
799++++++++++++++++++++++
800
801Enable this option with :kconfig:option:`CONFIG_POSIX_MESSAGE_PASSING`.
802
803.. csv-table:: _POSIX_MESSAGE_PASSING
804   :header: API, Supported
805   :widths: 50,10
806
807    mq_close(),yes
808    mq_getattr(),yes
809    mq_notify(),yes
810    mq_open(),yes
811    mq_receive(),yes
812    mq_send(),yes
813    mq_setattr(),yes
814    mq_unlink(),yes
815
816.. _posix_option_monotonic_clock:
817
818_POSIX_MONOTONIC_CLOCK
819++++++++++++++++++++++
820
821Enable this option with :kconfig:option:`CONFIG_POSIX_MONOTONIC_CLOCK`.
822
823.. csv-table:: _POSIX_MONOTONIC_CLOCK
824   :header: API, Supported
825   :widths: 50,10
826
827    CLOCK_MONOTONIC,yes
828
829.. _posix_option_priority_scheduling:
830
831_POSIX_PRIORITY_SCHEDULING
832++++++++++++++++++++++++++
833
834As processes are not yet supported in Zephyr, the functions ``sched_rr_get_interval()``,
835``sched_setparam()``, and ``sched_setscheduler()`` are expected to fail setting ``errno``
836to ``ENOSYS``:ref:`†<posix_undefined_behaviour>`.
837
838Enable this option with :kconfig:option:`CONFIG_POSIX_PRIORITY_SCHEDULING`.
839
840.. csv-table:: _POSIX_PRIORITY_SCHEDULING
841   :header: API, Supported
842   :widths: 50,10
843
844    sched_get_priority_max(),yes
845    sched_get_priority_min(),yes
846    sched_getparam(),yes
847    sched_getscheduler(),yes
848    sched_rr_get_interval(),yes :ref:`†<posix_undefined_behaviour>`
849    sched_setparam(),yes :ref:`†<posix_undefined_behaviour>`
850    sched_setscheduler(),yes :ref:`†<posix_undefined_behaviour>`
851    sched_yield(),yes
852
853.. _posix_option_raw_sockets:
854
855_POSIX_RAW_SOCKETS
856++++++++++++++++++
857
858Raw sockets are supported.
859
860For more information, please refer to :kconfig:option:`CONFIG_NET_SOCKETS_PACKET`.
861
862Enable this option with :kconfig:option:`CONFIG_POSIX_RAW_SOCKETS`.
863
864.. _posix_option_reader_writer_locks:
865
866_POSIX_READER_WRITER_LOCKS
867++++++++++++++++++++++++++
868
869Enable this option with :kconfig:option:`CONFIG_POSIX_READER_WRITER_LOCKS`.
870
871.. csv-table:: _POSIX_READER_WRITER_LOCKS
872   :header: API, Supported
873   :widths: 50,10
874
875    pthread_rwlock_destroy(),yes
876    pthread_rwlock_init(),yes
877    pthread_rwlock_rdlock(),yes
878    pthread_rwlock_tryrdlock(),yes
879    pthread_rwlock_trywrlock(),yes
880    pthread_rwlock_unlock(),yes
881    pthread_rwlock_wrlock(),yes
882    pthread_rwlockattr_destroy(),yes
883    pthread_rwlockattr_getpshared(),yes
884    pthread_rwlockattr_init(),yes
885    pthread_rwlockattr_setpshared(),yes
886
887..
888   this link is "deprecated" - mainly left here so that older links still work
889.. _posix_shared_memory_objects:
890
891.. _posix_option_shared_memory_objects:
892
893_POSIX_SHARED_MEMORY_OBJECTS
894++++++++++++++++++++++++++++
895
896Enable this option with :kconfig:option:`CONFIG_POSIX_SHARED_MEMORY_OBJECTS`.
897
898.. csv-table:: _POSIX_SHARED_MEMORY_OBJECTS
899   :header: API, Supported
900   :widths: 50,10
901
902    mmap(), yes
903    munmap(), yes
904    shm_open(), yes
905    shm_unlink(), yes
906
907.. _posix_option_synchronized_io:
908
909_POSIX_SYNCHRONIZED_IO
910++++++++++++++++++++++
911
912Enable this option with :kconfig:option:`CONFIG_POSIX_SYNCHRONIZED_IO`.
913
914.. csv-table:: _POSIX_SYNCHRONIZED_IO
915   :header: API, Supported
916   :widths: 50,10
917
918    fdatasync(),yes
919    fsync(),yes
920    msync(),yes
921
922.. _posix_option_thread_attr_stackaddr:
923
924_POSIX_THREAD_ATTR_STACKADDR
925++++++++++++++++++++++++++++
926
927Enable this option with :kconfig:option:`CONFIG_POSIX_THREAD_ATTR_STACKADDR`.
928
929.. csv-table:: _POSIX_THREAD_ATTR_STACKADDR
930   :header: API, Supported
931   :widths: 50,10
932
933    pthread_attr_getstackaddr(),yes
934    pthread_attr_setstackaddr(),yes
935
936.. _posix_option_thread_attr_stacksize:
937
938_POSIX_THREAD_ATTR_STACKSIZE
939++++++++++++++++++++++++++++
940
941Enable this option with :kconfig:option:`CONFIG_POSIX_THREAD_ATTR_STACKSIZE`.
942
943.. csv-table:: _POSIX_THREAD_ATTR_STACKSIZE
944   :header: API, Supported
945   :widths: 50,10
946
947    pthread_attr_getstacksize(),yes
948    pthread_attr_setstacksize(),yes
949
950.. _posix_option_thread_cputime:
951
952_POSIX_THREAD_CPUTIME
953+++++++++++++++++++++
954
955Enable this option with :kconfig:option:`CONFIG_POSIX_THREAD_CPUTIME`.
956
957.. csv-table:: _POSIX_THREAD_CPUTIME
958   :header: API, Supported
959   :widths: 50,10
960
961    CLOCK_THREAD_CPUTIME_ID,yes
962    pthread_getcpuclockid(),yes
963
964.. _posix_option_thread_prio_inherit:
965
966_POSIX_THREAD_PRIO_INHERIT
967++++++++++++++++++++++++++
968
969Enable this option with :kconfig:option:`CONFIG_POSIX_THREAD_PRIO_INHERIT`.
970
971.. csv-table:: _POSIX_THREAD_PRIO_INHERIT
972   :header: API, Supported
973   :widths: 50,10
974
975    pthread_mutexattr_getprotocol(),yes
976    pthread_mutexattr_setprotocol(),yes
977
978.. _posix_option_thread_prio_protect:
979
980_POSIX_THREAD_PRIO_PROTECT
981++++++++++++++++++++++++++
982
983Enable this option with :kconfig:option:`CONFIG_POSIX_THREAD_PRIO_PROTECT`.
984
985.. csv-table:: _POSIX_THREAD_PRIO_PROTECT
986   :header: API, Supported
987   :widths: 50,10
988
989    pthread_mutex_getprioceiling(),yes
990    pthread_mutex_setprioceiling(),yes
991    pthread_mutexattr_getprioceiling(),yes
992    pthread_mutexattr_getprotocol(),yes
993    pthread_mutexattr_setprioceiling(),yes
994    pthread_mutexattr_setprotocol(),yes
995
996.. _posix_option_thread_priority_scheduling:
997
998_POSIX_THREAD_PRIORITY_SCHEDULING
999+++++++++++++++++++++++++++++++++
1000
1001Enable this option with :kconfig:option:`CONFIG_POSIX_THREAD_PRIORITY_SCHEDULING`.
1002
1003.. csv-table:: _POSIX_THREAD_PRIORITY_SCHEDULING
1004   :header: API, Supported
1005   :widths: 50,10
1006
1007    pthread_attr_getinheritsched(),yes
1008    pthread_attr_getschedpolicy(),yes
1009    pthread_attr_getscope(),yes
1010    pthread_attr_setinheritsched(),yes
1011    pthread_attr_setschedpolicy(),yes
1012    pthread_attr_setscope(),yes
1013    pthread_getschedparam(),yes
1014    pthread_setschedparam(),yes
1015    pthread_setschedprio(),yes
1016
1017.. _posix_option_thread_safe_functions:
1018
1019_POSIX_THREAD_SAFE_FUNCTIONS
1020++++++++++++++++++++++++++++
1021
1022Enable this option with :kconfig:option:`CONFIG_POSIX_THREAD_SAFE_FUNCTIONS`.
1023
1024.. csv-table:: _POSIX_THREAD_SAFE_FUNCTIONS
1025    :header: API, Supported
1026    :widths: 50,10
1027
1028    asctime_r(), yes
1029    ctime_r(), yes (UTC timezone only)
1030    flockfile(),
1031    ftrylockfile(),
1032    funlockfile(),
1033    getc_unlocked(),
1034    getchar_unlocked(),
1035    getgrgid_r(),yes :ref:`†<posix_undefined_behaviour>`
1036    getgrnam_r(),yes :ref:`†<posix_undefined_behaviour>`
1037    getpwnam_r(),yes :ref:`†<posix_undefined_behaviour>`
1038    getpwuid_r(),yes :ref:`†<posix_undefined_behaviour>`
1039    gmtime_r(), yes
1040    localtime_r(), yes (UTC timezone only)
1041    putc_unlocked(),
1042    putchar_unlocked(),
1043    rand_r(), yes
1044    readdir_r(), yes
1045    strerror_r(), yes
1046    strtok_r(), yes
1047
1048.. _posix_option_timeouts:
1049
1050_POSIX_TIMEOUTS
1051+++++++++++++++
1052
1053Enable this option with :kconfig:option:`CONFIG_POSIX_TIMEOUTS`.
1054
1055.. csv-table:: _POSIX_TIMEOUTS
1056   :header: API, Supported
1057   :widths: 50,10
1058
1059    mq_timedreceive(),yes
1060    mq_timedsend(),yes
1061    pthread_mutex_timedlock(),yes
1062    pthread_rwlock_timedrdlock(),yes
1063    pthread_rwlock_timedwrlock(),yes
1064    sem_timedwait(),yes
1065    posix_trace_timedgetnext_event(),
1066
1067.. _posix_option_xopen_streams:
1068
1069_XOPEN_STREAMS
1070++++++++++++++
1071
1072With the exception of ``ioctl()``, functions in the ``_XOPEN_STREAMS`` option group are not
1073implemented in Zephyr but are provided so that conformant applications can still link.
1074Unimplemented functions in this option group will fail, setting ``errno`` to ``ENOSYS``
1075:ref:`†<posix_undefined_behaviour>`.
1076
1077Enable this option with :kconfig:option:`CONFIG_XOPEN_STREAMS`.
1078
1079.. csv-table:: _XOPEN_STREAMS
1080   :header: API, Supported
1081   :widths: 50,10
1082
1083    fattach(), yes :ref:`†<posix_undefined_behaviour>`
1084    fdetach(), yes :ref:`†<posix_undefined_behaviour>`
1085    getmsg(), yes :ref:`†<posix_undefined_behaviour>`
1086    getpmsg(), yes :ref:`†<posix_undefined_behaviour>`
1087    ioctl(), yes
1088    isastream(), yes :ref:`†<posix_undefined_behaviour>`
1089    putmsg(), yes :ref:`†<posix_undefined_behaviour>`
1090    putpmsg(), yes :ref:`†<posix_undefined_behaviour>`
1091
1092.. _Subprofiling Considerations:
1093    https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_subprofiles.html
1094