glibc/manual/ipc.texi
Arjun Shankar a3a5634d9b manual: Consolidate POSIX Semaphores docs in Threads chapter
This commit moves the `sem_*' family of functions from the IPC chapter,
replacing them with a reference to their new location in the Threads
chapter.  `sem_clockwait' is also moved out of the Non-POSIX Extensions
subsection since it is now included in the standard since Issue 8:
https://pubs.opengroup.org/onlinepubs/9799919799/functions/sem_clockwait.html

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-01-30 15:18:45 +01:00

51 lines
1.7 KiB
Text

@node Inter-Process Communication, Job Control, Processes, Top
@c %MENU% All about inter-process communication
@chapter Inter-Process Communication
@cindex ipc
This chapter describes the @glibcadj{} inter-process communication primitives.
@menu
* Semaphores:: Support for creating and managing semaphores
@end menu
@node Semaphores
@section Semaphores
@Theglibc{} implements the semaphore APIs as defined in POSIX and
System V. Semaphores can be used by multiple processes to coordinate shared
resources. The following is a complete list of the semaphore functions provided
by @theglibc{}.
@c Need descriptions for all of these functions.
@subsection System V Semaphores
@deftypefun int semctl (int @var{semid}, int @var{semnum}, int @var{cmd})
@safety{@prelim{}@mtsafe{}@assafe{}@acunsafe{@acucorrupt{/linux}}}
@c syscall(ipc) ok
@c
@c AC-unsafe because we need to translate the new kernel
@c semid_ds buf into the userspace layout. Cancellation
@c at that point results in an inconsistent userspace
@c semid_ds.
@end deftypefun
@deftypefun int semget (key_t @var{key}, int @var{nsems}, int @var{semflg})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
@c syscall(ipc) ok
@end deftypefun
@deftypefun int semop (int @var{semid}, struct sembuf *@var{sops}, size_t @var{nsops})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
@c syscall(ipc) ok
@end deftypefun
@deftypefun int semtimedop (int @var{semid}, struct sembuf *@var{sops}, size_t @var{nsops}, const struct timespec *@var{timeout})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
@c syscall(ipc) ok
@end deftypefun
@subsection POSIX Semaphores
@Theglibc{} provides POSIX semaphores as well. These functions' names begin
with @code{sem_} and they are declared in @file{semaphore.h}. @xref{POSIX
Semaphores}.