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

sem_unlink.3p (3624B)


  1. '\" et
  2. .TH SEM_UNLINK "3P" 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. sem_unlink
  12. \(em remove a named semaphore
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <semaphore.h>
  17. .P
  18. int sem_unlink(const char *\fIname\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIsem_unlink\fR()
  23. function shall remove the semaphore named by the string
  24. .IR name .
  25. If the semaphore named by
  26. .IR name
  27. is currently referenced by other processes, then
  28. \fIsem_unlink\fR()
  29. shall have no effect on the state of the semaphore. If one or more
  30. processes have the semaphore open when
  31. \fIsem_unlink\fR()
  32. is called, destruction of the semaphore is postponed until all
  33. references to the semaphore have been destroyed by calls to
  34. \fIsem_close\fR(),
  35. \fI_exit\fR(),
  36. or
  37. .IR exec .
  38. Calls to
  39. \fIsem_open\fR()
  40. to recreate or reconnect to the semaphore refer to a new semaphore
  41. after
  42. \fIsem_unlink\fR()
  43. is called. The
  44. \fIsem_unlink\fR()
  45. call shall not block until all references have been destroyed; it
  46. shall return immediately.
  47. .SH "RETURN VALUE"
  48. Upon successful completion, the
  49. \fIsem_unlink\fR()
  50. function shall return a value of 0. Otherwise, the semaphore shall not
  51. be changed and the function shall return a value of \-1 and set
  52. .IR errno
  53. to indicate the error.
  54. .SH ERRORS
  55. The
  56. \fIsem_unlink\fR()
  57. function shall fail if:
  58. .TP
  59. .BR EACCES
  60. Permission is denied to unlink the named semaphore.
  61. .TP
  62. .BR ENOENT
  63. The named semaphore does not exist.
  64. .P
  65. The
  66. \fIsem_unlink\fR()
  67. function may fail if:
  68. .TP
  69. .BR ENAMETOOLONG
  70. .br
  71. The length of the
  72. .IR name
  73. argument exceeds
  74. {_POSIX_PATH_MAX}
  75. on systems that do not support the XSI option
  76. or exceeds
  77. {_XOPEN_PATH_MAX}
  78. on XSI systems,
  79. or has a pathname component that is longer than
  80. {_POSIX_NAME_MAX}
  81. on systems that do not support the XSI option
  82. or longer than
  83. {_XOPEN_NAME_MAX}
  84. on XSI systems.
  85. A call to
  86. \fIsem_unlink\fR()
  87. with a
  88. .IR name
  89. argument that contains the same semaphore name as was previously used
  90. in a successful
  91. \fIsem_open\fR()
  92. call shall not give an
  93. .BR [ENAMETOOLONG]
  94. error.
  95. .LP
  96. .IR "The following sections are informative."
  97. .SH EXAMPLES
  98. None.
  99. .SH "APPLICATION USAGE"
  100. None.
  101. .SH RATIONALE
  102. None.
  103. .SH "FUTURE DIRECTIONS"
  104. A future version might require the
  105. \fIsem_open\fR()
  106. and
  107. \fIsem_unlink\fR()
  108. functions to have semantics similar to normal file system operations.
  109. .SH "SEE ALSO"
  110. .IR "\fIsemctl\fR\^(\|)",
  111. .IR "\fIsemget\fR\^(\|)",
  112. .IR "\fIsemop\fR\^(\|)",
  113. .IR "\fIsem_close\fR\^(\|)",
  114. .IR "\fIsem_open\fR\^(\|)"
  115. .P
  116. The Base Definitions volume of POSIX.1\(hy2017,
  117. .IR "\fB<semaphore.h>\fP"
  118. .\"
  119. .SH COPYRIGHT
  120. Portions of this text are reprinted and reproduced in electronic form
  121. from IEEE Std 1003.1-2017, Standard for Information Technology
  122. -- Portable Operating System Interface (POSIX), The Open Group Base
  123. Specifications Issue 7, 2018 Edition,
  124. Copyright (C) 2018 by the Institute of
  125. Electrical and Electronics Engineers, Inc and The Open Group.
  126. In the event of any discrepancy between this version and the original IEEE and
  127. The Open Group Standard, the original IEEE and The Open Group Standard
  128. is the referee document. The original Standard can be obtained online at
  129. http://www.opengroup.org/unix/online.html .
  130. .PP
  131. Any typographical or formatting errors that appear
  132. in this page are most likely
  133. to have been introduced during the conversion of the source files to
  134. man page format. To report such errors, see
  135. https://www.kernel.org/doc/man-pages/reporting_bugs.html .