1SHMDT(3P)                  POSIX Programmer's Manual                 SHMDT(3P)
2
3
4

PROLOG

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

NAME

12       shmdt — XSI shared memory detach operation
13

SYNOPSIS

15       #include <sys/shm.h>
16
17       int shmdt(const void *shmaddr);
18

DESCRIPTION

20       The shmdt() function operates on XSI shared memory (see the Base  Defi‐
21       nitions  volume  of POSIX.1‐2017, Section 3.346, Shared Memory Object).
22       It is unspecified whether this function interoperates with the realtime
23       interprocess communication facilities defined in Section 2.8, Realtime.
24
25       The  shmdt() function detaches the shared memory segment located at the
26       address specified by shmaddr from the  address  space  of  the  calling
27       process.
28

RETURN VALUE

30       Upon  successful  completion,  shmdt()  shall  decrement  the  value of
31       shm_nattch in the data structure associated with the shared  memory  ID
32       of the attached shared memory segment and return 0. Also, the shm_dtime
33       timestamp shall be set to the current time,  as  described  in  Section
34       2.7.1, IPC General Description.
35
36       Otherwise,  the  shared  memory  segment shall not be detached, shmdt()
37       shall return -1, and errno shall be set to indicate the error.
38

ERRORS

40       The shmdt() function shall fail if:
41
42       EINVAL The value of shmaddr is not the data segment start address of  a
43              shared memory segment.
44
45       The following sections are informative.
46

EXAMPLES

48       None.
49

APPLICATION USAGE

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 Section 2.7, XSI Interprocess Communication can be  easily
55       modified to use the alternative interfaces.
56

RATIONALE

58       None.
59

FUTURE DIRECTIONS

61       None.
62

SEE ALSO

64       Section  2.7,  XSI  Interprocess  Communication, Section 2.8, Realtime,
65       exec,  exit(),  fork(),  shmat(),   shmctl(),   shmget(),   shm_open(),
66       shm_unlink()
67
68       The Base Definitions volume of POSIX.1‐2017, Section 3.346, Shared Mem‐
69       ory Object, <sys_shm.h>
70
72       Portions of this text are reprinted and reproduced in  electronic  form
73       from  IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
74       table Operating System Interface (POSIX), The Open Group Base  Specifi‐
75       cations  Issue  7, 2018 Edition, Copyright (C) 2018 by the Institute of
76       Electrical and Electronics Engineers, Inc and The Open Group.   In  the
77       event of any discrepancy between this version and the original IEEE and
78       The Open Group Standard, the original IEEE and The Open Group  Standard
79       is  the  referee document. The original Standard can be obtained online
80       at http://www.opengroup.org/unix/online.html .
81
82       Any typographical or formatting errors that appear  in  this  page  are
83       most likely to have been introduced during the conversion of the source
84       files to man page format. To report such errors,  see  https://www.ker
85       nel.org/doc/man-pages/reporting_bugs.html .
86
87
88
89IEEE/The Open Group                  2017                            SHMDT(3P)
Impressum