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

shm_unlink.3p (4099B)


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