1SHMDT(3P) POSIX Programmer's Manual SHMDT(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
11
13 shmdt — XSI shared memory detach operation
14
16 #include <sys/shm.h>
17
18 int shmdt(const void *shmaddr);
19
21 The shmdt() function operates on XSI shared memory (see the Base Defi‐
22 nitions volume of POSIX.1‐2008, Section 3.342, Shared Memory Object).
23 It is unspecified whether this function interoperates with the realtime
24 interprocess communication facilities defined in Section 2.8, Realtime.
25
26 The shmdt() function detaches the shared memory segment located at the
27 address specified by shmaddr from the address space of the calling
28 process.
29
31 Upon successful completion, shmdt() shall decrement the value of
32 shm_nattch in the data structure associated with the shared memory ID
33 of the attached shared memory segment and return 0. Also, the shm_dtime
34 timestamp shall be set to the current time, as described in Section
35 2.7.1, IPC General Description.
36
37 Otherwise, the shared memory segment shall not be detached, shmdt()
38 shall return −1, and errno shall be set to indicate the error.
39
41 The shmdt() function shall fail if:
42
43 EINVAL The value of shmaddr is not the data segment start address of a
44 shared memory segment.
45
46 The following sections are informative.
47
49 None.
50
52 The POSIX Realtime Extension defines alternative interfaces for inter‐
53 process communication. Application developers who need to use IPC
54 should design their applications so that modules using the IPC routines
55 described in Section 2.7, XSI Interprocess Communication can be easily
56 modified to use the alternative interfaces.
57
59 None.
60
62 None.
63
65 Section 2.7, XSI Interprocess Communication, Section 2.8, Realtime,
66 exec, exit(), fork(), shmat(), shmctl(), shmget(), shm_open(),
67 shm_unlink()
68
69 The Base Definitions volume of POSIX.1‐2008, Section 3.342, Shared Mem‐
70 ory Object, <sys_shm.h>
71
73 Portions of this text are reprinted and reproduced in electronic form
74 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
75 -- Portable Operating System Interface (POSIX), The Open Group Base
76 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
77 cal and Electronics Engineers, Inc and The Open Group. (This is
78 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
79 event of any discrepancy between this version and the original IEEE and
80 The Open Group Standard, the original IEEE and The Open Group Standard
81 is the referee document. The original Standard can be obtained online
82 at http://www.unix.org/online.html .
83
84 Any typographical or formatting errors that appear in this page are
85 most likely to have been introduced during the conversion of the source
86 files to man page format. To report such errors, see https://www.ker‐
87 nel.org/doc/man-pages/reporting_bugs.html .
88
89
90
91IEEE/The Open Group 2013 SHMDT(3P)