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
12 shmdt - XSI shared memory detach operation
13
15 #include <sys/shm.h>
16
17 int shmdt(const void *shmaddr);
18
19
21 The shmdt() function operates on XSI shared memory (see the Base Defi‐
22 nitions volume of IEEE Std 1003.1-2001, Section 3.340, Shared Memory
23 Object). It is unspecified whether this function interoperates with the
24 realtime interprocess communication facilities defined in 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.
34
35 Otherwise, the shared memory segment shall not be detached, shmdt()
36 shall return -1, and errno shall be set to indicate the error.
37
39 The shmdt() function shall fail if:
40
41 EINVAL The value of shmaddr is not the data segment start address of a
42 shared memory segment.
43
44
45 The following sections are informative.
46
48 None.
49
51 The POSIX Realtime Extension defines alternative interfaces for inter‐
52 process communication. Application developers who need to use IPC
53 should design their applications so that modules using the IPC routines
54 described in XSI Interprocess Communication can be easily modified to
55 use the alternative interfaces.
56
58 None.
59
61 None.
62
64 XSI Interprocess Communication, Realtime, exec() , exit(), fork(),
65 shmat(), shmctl(), shmget(), shm_open(), shm_unlink(), the Base Defini‐
66 tions volume of IEEE Std 1003.1-2001, <sys/shm.h>
67
69 Portions of this text are reprinted and reproduced in electronic form
70 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
71 -- Portable Operating System Interface (POSIX), The Open Group Base
72 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
73 Electrical and Electronics Engineers, Inc and The Open Group. In the
74 event of any discrepancy between this version and the original IEEE and
75 The Open Group Standard, the original IEEE and The Open Group Standard
76 is the referee document. The original Standard can be obtained online
77 at http://www.opengroup.org/unix/online.html .
78
79
80
81IEEE/The Open Group 2003 SHMDT(3P)