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

shmdt.3p (3417B)


  1. '\" et
  2. .TH SHMDT "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. shmdt
  12. \(em XSI shared memory detach operation
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <sys/shm.h>
  17. .P
  18. int shmdt(const void *\fIshmaddr\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIshmdt\fR()
  23. function operates on XSI shared memory (see the Base Definitions volume of POSIX.1\(hy2017,
  24. .IR "Section 3.346" ", " "Shared Memory Object").
  25. It is unspecified whether this function interoperates with the
  26. realtime interprocess communication facilities defined in
  27. .IR "Section 2.8" ", " "Realtime".
  28. .P
  29. The
  30. \fIshmdt\fR()
  31. function detaches the shared memory segment located at the address
  32. specified by
  33. .IR shmaddr
  34. from the address space of the calling process.
  35. .SH "RETURN VALUE"
  36. Upon successful completion,
  37. \fIshmdt\fR()
  38. shall decrement the value of
  39. .IR shm_nattch
  40. in the data structure associated with the shared memory ID of the
  41. attached shared memory segment and return 0. Also, the
  42. .IR shm_dtime
  43. timestamp shall be set to the current time, as described in
  44. .IR "Section 2.7.1" ", " "IPC General Description".
  45. .P
  46. Otherwise, the shared memory segment shall not be detached,
  47. \fIshmdt\fR()
  48. shall return \-1, and
  49. .IR errno
  50. shall be set to indicate the error.
  51. .SH ERRORS
  52. The
  53. \fIshmdt\fR()
  54. function shall fail if:
  55. .TP
  56. .BR EINVAL
  57. The value of
  58. .IR shmaddr
  59. is not the data segment start address of a shared memory segment.
  60. .LP
  61. .IR "The following sections are informative."
  62. .SH EXAMPLES
  63. None.
  64. .SH "APPLICATION USAGE"
  65. The POSIX Realtime Extension defines alternative interfaces for interprocess
  66. communication. Application developers who need to use IPC should
  67. design their applications so that modules using the IPC routines
  68. described in
  69. .IR "Section 2.7" ", " "XSI Interprocess Communication"
  70. can be easily modified to use the alternative interfaces.
  71. .SH RATIONALE
  72. None.
  73. .SH "FUTURE DIRECTIONS"
  74. None.
  75. .SH "SEE ALSO"
  76. .IR "Section 2.7" ", " "XSI Interprocess Communication",
  77. .IR "Section 2.8" ", " "Realtime",
  78. .IR "\fIexec\fR\^",
  79. .IR "\fIexit\fR\^(\|)",
  80. .IR "\fIfork\fR\^(\|)",
  81. .IR "\fIshmat\fR\^(\|)",
  82. .IR "\fIshmctl\fR\^(\|)",
  83. .IR "\fIshmget\fR\^(\|)",
  84. .IR "\fIshm_open\fR\^(\|)",
  85. .IR "\fIshm_unlink\fR\^(\|)"
  86. .P
  87. The Base Definitions volume of POSIX.1\(hy2017,
  88. .IR "Section 3.346" ", " "Shared Memory Object",
  89. .IR "\fB<sys_shm.h>\fP"
  90. .\"
  91. .SH COPYRIGHT
  92. Portions of this text are reprinted and reproduced in electronic form
  93. from IEEE Std 1003.1-2017, Standard for Information Technology
  94. -- Portable Operating System Interface (POSIX), The Open Group Base
  95. Specifications Issue 7, 2018 Edition,
  96. Copyright (C) 2018 by the Institute of
  97. Electrical and Electronics Engineers, Inc and The Open Group.
  98. In the event of any discrepancy between this version and the original IEEE and
  99. The Open Group Standard, the original IEEE and The Open Group Standard
  100. is the referee document. The original Standard can be obtained online at
  101. http://www.opengroup.org/unix/online.html .
  102. .PP
  103. Any typographical or formatting errors that appear
  104. in this page are most likely
  105. to have been introduced during the conversion of the source files to
  106. man page format. To report such errors, see
  107. https://www.kernel.org/doc/man-pages/reporting_bugs.html .