ipc.texi 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. @node Inter-Process Communication, Job Control, Processes, Top
  2. @c %MENU% All about inter-process communication
  3. @chapter Inter-Process Communication
  4. @cindex ipc
  5. This chapter describes the @glibcadj{} inter-process communication primitives.
  6. @menu
  7. * Semaphores:: Support for creating and managing semaphores
  8. @end menu
  9. @node Semaphores
  10. @section Semaphores
  11. @Theglibc{} implements the semaphore APIs as defined in POSIX and
  12. System V. Semaphores can be used by multiple processes to coordinate shared
  13. resources. The following is a complete list of the semaphore functions provided
  14. by @theglibc{}.
  15. @c Need descriptions for all of these functions.
  16. @subsection System V Semaphores
  17. @deftypefun int semctl (int @var{semid}, int @var{semnum}, int @var{cmd})
  18. @safety{@prelim{}@mtsafe{}@assafe{}@acunsafe{@acucorrupt{/linux}}}
  19. @c syscall(ipc) ok
  20. @c
  21. @c AC-unsafe because we need to translate the new kernel
  22. @c semid_ds buf into the userspace layout. Cancellation
  23. @c at that point results in an inconsistent userspace
  24. @c semid_ds.
  25. @end deftypefun
  26. @deftypefun int semget (key_t @var{key}, int @var{nsems}, int @var{semflg})
  27. @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
  28. @c syscall(ipc) ok
  29. @end deftypefun
  30. @deftypefun int semop (int @var{semid}, struct sembuf *@var{sops}, size_t @var{nsops})
  31. @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
  32. @c syscall(ipc) ok
  33. @end deftypefun
  34. @deftypefun int semtimedop (int @var{semid}, struct sembuf *@var{sops}, size_t @var{nsops}, const struct timespec *@var{timeout})
  35. @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
  36. @c syscall(ipc) ok
  37. @end deftypefun
  38. @subsection POSIX Semaphores
  39. @Theglibc{} provides POSIX semaphores as well. These functions' names begin
  40. with @code{sem_} and they are declared in @file{semaphore.h}. @xref{POSIX
  41. Semaphores}.