]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man2/shmop.2
pldd.1, bpf.2, chdir.2, clone.2, fanotify_init.2, fanotify_mark.2, intro.2, ipc.2...
[thirdparty/man-pages.git] / man2 / shmop.2
index 06cef8ac5af5a84827e2499c6d20a606d6bc048d..67c3fee6f6d6d49b933839efc9dad5e47ac77453 100644 (file)
 .\"
 .\" FIXME . Add an example program to this page.
 .\"
-.TH SHMOP 2 2014-07-08 "Linux" "Linux Programmer's Manual"
+.TH SHMOP 2 2019-08-02 "Linux" "Linux Programmer's Manual"
 .SH NAME
 shmat, shmdt \- System V shared memory operations
 .SH SYNOPSIS
 .nf
 .B #include <sys/types.h>
 .B #include <sys/shm.h>
-
+.PP
 .BI "void *shmat(int " shmid ", const void *" shmaddr ", int " shmflg );
-
+.PP
 .BI "int shmdt(const void *" shmaddr );
 .fi
 .SH DESCRIPTION
@@ -63,7 +63,7 @@ with one of the following criteria:
 If
 .I shmaddr
 is NULL,
-the system chooses a suitable (unused) address at which to attach
+the system chooses a suitable (unused) page-aligned address to attach
 the segment.
 .IP *
 If
@@ -173,7 +173,7 @@ returns the address of the attached shared memory segment; on error,
 is returned, and
 .I errno
 is set to indicate the cause of the error.
-
+.PP
 On success,
 .BR shmdt ()
 returns 0; on error \-1 is returned, and
@@ -190,7 +190,7 @@ is set to one of the following:
 The calling process does not have the required permissions for
 the requested attach type, and does not have the
 .B CAP_IPC_OWNER
-capability.
+capability in the user namespace that governs its IPC namespace.
 .TP
 .B EIDRM
 \fIshmid\fP points to a removed identifier.
@@ -228,7 +228,7 @@ is not aligned on a page boundary.
 .SH CONFORMING TO
 POSIX.1-2001, POSIX.1-2008, SVr4.
 .\" SVr4 documents an additional error condition EMFILE.
-
+.PP
 In SVID 3 (or perhaps earlier),
 the type of the \fIshmaddr\fP argument was changed from
 .I "char\ *"
@@ -245,15 +245,15 @@ into
 After a
 .BR fork (2),
 the child inherits the attached shared memory segments.
-
+.PP
 After an
 .BR execve (2),
 all attached shared memory segments are detached from the process.
-
+.PP
 Upon
 .BR _exit (2),
 all attached shared memory segments are detached from the process.
-
+.PP
 Using
 .BR shmat ()
 with
@@ -270,7 +270,7 @@ On Linux, it is possible to attach a shared memory segment even if it
 is already marked to be deleted.
 However, POSIX.1 does not specify this behavior and
 many other implementations do not support it.
-.LP
+.PP
 The following system parameter affects
 .BR shmat ():
 .TP
@@ -284,8 +284,10 @@ in order either to ensure good CPU cache performance or to ensure that
 different attaches of the same segment have consistent views
 within the CPU cache.
 .B SHMLBA
-is normally some multiple of the system page size
-(on many Linux architectures, it is the same as the system page size).
+is normally some multiple of the system page size.
+(On many Linux architectures,
+.B SHMLBA
+is the same as the system page size.)
 .PP
 The implementation places no intrinsic per-process limit on the
 number of shared memory segments
@@ -297,4 +299,4 @@ number of shared memory segments
 .BR shmget (2),
 .BR capabilities (7),
 .BR shm_overview (7),
-.BR svipc (7)
+.BR sysvipc (7)