/
githubmirror
/
glibc
Обзор
Документация
Войти
/
githubmirror
/
glibc
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
manual/ipc.texi
51 строка
2 KB
Arjun Shankar
manual: Consolidate POSIX Semaphores docs in Threads chapter
30 янв 2025, 17:18
30 янв 2025, 17:18
a3a5634
Код
Авторство
О чём код?
@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}.