logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

sys_sem.h.0p (3856B)


  1. '\" et
  2. .TH sys_sem.h "0P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. sys/sem.h
  12. \(em XSI semaphore facility
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <sys/sem.h>
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR <sys/sem.h>
  21. header shall define the following symbolic constant for use as a
  22. semaphore operation flag:
  23. .IP SEM_UNDO 12
  24. Set up adjust on exit entry.
  25. .P
  26. The
  27. .IR <sys/sem.h>
  28. header shall define the following symbolic constants for use as
  29. commands for the
  30. \fIsemctl\fR()
  31. function:
  32. .IP GETNCNT 12
  33. Get
  34. .IR semncnt .
  35. .IP GETPID 12
  36. Get
  37. .IR sempid .
  38. .IP GETVAL 12
  39. Get
  40. .IR semval .
  41. .IP GETALL 12
  42. Get all cases of
  43. .IR semval .
  44. .IP GETZCNT 12
  45. Get
  46. .IR semzcnt .
  47. .IP SETVAL 12
  48. Set
  49. .IR semval .
  50. .IP SETALL 12
  51. Set all cases of
  52. .IR semval .
  53. .P
  54. The
  55. .IR <sys/sem.h>
  56. header shall define the
  57. .BR semid_ds
  58. structure, which shall include the following members:
  59. .sp
  60. .RS 4
  61. .nf
  62. struct ipc_perm sem_perm \fROperation permission structure.\fR
  63. unsigned short sem_nsems \fRNumber of semaphores in set.\fR
  64. time_t sem_otime \fRLast \fIsemop\fP\^(\|) time.\fR
  65. time_t sem_ctime \fRLast time changed by \fIsemctl\fP\^(\|).\fR
  66. .fi
  67. .P
  68. .RE
  69. .P
  70. The
  71. .IR <sys/sem.h>
  72. header shall define the
  73. .BR pid_t ,
  74. .BR size_t ,
  75. and
  76. .BR time_t
  77. types as described in
  78. .IR <sys/types.h> .
  79. .P
  80. A semaphore shall be represented by an anonymous structure,
  81. which shall include the following members:
  82. .sp
  83. .RS 4
  84. .nf
  85. unsigned short semval \fRSemaphore value.\fR
  86. pid_t sempid \fRProcess ID of last operation.\fR
  87. unsigned short semncnt \fRNumber of processes waiting for \fIsemval\fR
  88. \fRto become greater than current value.\fR
  89. unsigned short semzcnt \fRNumber of processes waiting for \fIsemval\fR
  90. \fRto become 0.\fR
  91. .fi
  92. .P
  93. .RE
  94. .P
  95. The
  96. .IR <sys/sem.h>
  97. header shall define the
  98. .BR sembuf
  99. structure, which shall include the following members:
  100. .sp
  101. .RS 4
  102. .nf
  103. unsigned short sem_num \fRSemaphore number.\fR
  104. short sem_op \fRSemaphore operation.\fR
  105. short sem_flg \fROperation flags.\fR
  106. .fi
  107. .P
  108. .RE
  109. .P
  110. The following shall be declared as functions and may also be defined as
  111. macros. Function prototypes shall be provided.
  112. .sp
  113. .RS 4
  114. .nf
  115. int semctl(int, int, int, ...);
  116. int semget(key_t, int, int);
  117. int semop(int, struct sembuf *, size_t);
  118. .fi
  119. .P
  120. .RE
  121. .P
  122. In addition, the
  123. .IR <sys/sem.h>
  124. header shall include the
  125. .IR <sys/ipc.h>
  126. header.
  127. .LP
  128. .IR "The following sections are informative."
  129. .SH "APPLICATION USAGE"
  130. None.
  131. .SH RATIONALE
  132. None.
  133. .SH "FUTURE DIRECTIONS"
  134. None.
  135. .SH "SEE ALSO"
  136. .IR "\fB<sys_ipc.h>\fP",
  137. .IR "\fB<sys_types.h>\fP"
  138. .P
  139. The System Interfaces volume of POSIX.1\(hy2017,
  140. .IR "\fIsemctl\fR\^(\|)",
  141. .IR "\fIsemget\fR\^(\|)",
  142. .IR "\fIsemop\fR\^(\|)"
  143. .\"
  144. .SH COPYRIGHT
  145. Portions of this text are reprinted and reproduced in electronic form
  146. from IEEE Std 1003.1-2017, Standard for Information Technology
  147. -- Portable Operating System Interface (POSIX), The Open Group Base
  148. Specifications Issue 7, 2018 Edition,
  149. Copyright (C) 2018 by the Institute of
  150. Electrical and Electronics Engineers, Inc and The Open Group.
  151. In the event of any discrepancy between this version and the original IEEE and
  152. The Open Group Standard, the original IEEE and The Open Group Standard
  153. is the referee document. The original Standard can be obtained online at
  154. http://www.opengroup.org/unix/online.html .
  155. .PP
  156. Any typographical or formatting errors that appear
  157. in this page are most likely
  158. to have been introduced during the conversion of the source files to
  159. man page format. To report such errors, see
  160. https://www.kernel.org/doc/man-pages/reporting_bugs.html .