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_destroy.3p (2709B)


  1. '\" et
  2. .TH SEM_DESTROY "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_destroy
  12. \(em destroy an unnamed semaphore
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <semaphore.h>
  17. .P
  18. int sem_destroy(sem_t *\fIsem\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIsem_destroy\fR()
  23. function shall destroy the unnamed semaphore indicated by
  24. .IR sem .
  25. Only a semaphore that was created using
  26. \fIsem_init\fR()
  27. may be destroyed using
  28. \fIsem_destroy\fR();
  29. the effect of calling
  30. \fIsem_destroy\fR()
  31. with a named semaphore is undefined. The effect of subsequent use of
  32. the semaphore
  33. .IR sem
  34. is undefined until
  35. .IR sem
  36. is reinitialized by another call to
  37. \fIsem_init\fR().
  38. .P
  39. It is safe to destroy an initialized semaphore upon which no threads
  40. are currently blocked. The effect of destroying a semaphore upon which
  41. other threads are currently blocked is undefined.
  42. .SH "RETURN VALUE"
  43. Upon successful completion, a value of zero shall be returned. Otherwise,
  44. a value of \-1 shall be returned and
  45. .IR errno
  46. set to indicate the error.
  47. .SH ERRORS
  48. The
  49. \fIsem_destroy\fR()
  50. function may fail if:
  51. .TP
  52. .BR EINVAL
  53. The
  54. .IR sem
  55. argument is not a valid semaphore.
  56. .TP
  57. .BR EBUSY
  58. There are currently processes blocked on the semaphore.
  59. .LP
  60. .IR "The following sections are informative."
  61. .SH EXAMPLES
  62. None.
  63. .SH "APPLICATION USAGE"
  64. None.
  65. .SH RATIONALE
  66. None.
  67. .SH "FUTURE DIRECTIONS"
  68. None.
  69. .SH "SEE ALSO"
  70. .IR "\fIsemctl\fR\^(\|)",
  71. .IR "\fIsemget\fR\^(\|)",
  72. .IR "\fIsemop\fR\^(\|)",
  73. .IR "\fIsem_init\fR\^(\|)",
  74. .IR "\fIsem_open\fR\^(\|)"
  75. .P
  76. The Base Definitions volume of POSIX.1\(hy2017,
  77. .IR "\fB<semaphore.h>\fP"
  78. .\"
  79. .SH COPYRIGHT
  80. Portions of this text are reprinted and reproduced in electronic form
  81. from IEEE Std 1003.1-2017, Standard for Information Technology
  82. -- Portable Operating System Interface (POSIX), The Open Group Base
  83. Specifications Issue 7, 2018 Edition,
  84. Copyright (C) 2018 by the Institute of
  85. Electrical and Electronics Engineers, Inc and The Open Group.
  86. In the event of any discrepancy between this version and the original IEEE and
  87. The Open Group Standard, the original IEEE and The Open Group Standard
  88. is the referee document. The original Standard can be obtained online at
  89. http://www.opengroup.org/unix/online.html .
  90. .PP
  91. Any typographical or formatting errors that appear
  92. in this page are most likely
  93. to have been introduced during the conversion of the source files to
  94. man page format. To report such errors, see
  95. https://www.kernel.org/doc/man-pages/reporting_bugs.html .