-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
.\" Copyright (C) 2002 Michael Kerrisk <mtk.manpages@gmail.com>
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.\" FIXME . Add an example to this page
-.TH SHM_OPEN 3 2009-02-25 "Linux" "Linux Programmer's Manual"
+.TH SHM_OPEN 3 2015-01-22 "Linux" "Linux Programmer's Manual"
.SH NAME
-shm_open, shm_unlink \- Create/open or unlink POSIX shared memory objects
+shm_open, shm_unlink \- create/open or unlink POSIX shared memory objects
.SH SYNOPSIS
.B #include <sys/mman.h>
.br
.TP 1.1i
.B O_RDONLY
Open the object for read access.
-A shared memory object opened in this way can only be
+A shared memory object opened in this way can be
.BR mmap (2)ed
-for read (\fBPROT_READ\fP) access.
+only for read
+.RB ( PROT_READ )
+access.
.TP
.B O_RDWR
Open the object for read-write access.
Create the shared memory object if it does not exist.
The user and group ownership of the object are taken
from the corresponding effective IDs of the calling process,
-.\" In truth it is actually the file system IDs on Linux, but these
+.\" In truth it is actually the filesystem IDs on Linux, but these
.\" are nearly always the same as the effective IDs. (MTK, Jul 05)
and the object's
permission bits are set according to the low-order 9 bits of
(Symbolic definitions of these constants can be obtained by including
.IR <sys/stat.h> .)
.sp
-A new shared memory object initially has zero length \(em the size of the
+A new shared memory object initially has zero length\(emthe size of the
object can be set using
.BR ftruncate (2).
The newly allocated bytes of a shared memory
will fail (unless
.B O_CREAT
was specified, in which case a new, distinct object is created).
-.SH "RETURN VALUE"
+.SH RETURN VALUE
On success,
.BR shm_open ()
returns a nonnegative file descriptor.
that does not exist.
.SH VERSIONS
These functions are provided in glibc 2.2 and later.
-.SH "CONFORMING TO"
+.SH CONFORMING TO
POSIX.1-2001.
.LP
POSIX.1-2001 says that the group ownership of a newly created shared
memory object is set to either the calling process's effective group ID
or "a system default group ID".
-.SH "NOTES"
+.SH NOTES
.LP
POSIX leaves the behavior of the combination of
.B O_RDONLY
.B O_TRUNC
unspecified.
On Linux, this will successfully truncate an existing
-shared memory object \(em this may not be so on other Unix systems.
+shared memory object\(emthis may not be so on other UNIX systems.
.LP
The POSIX shared memory object implementation on Linux 2.4 makes use
-of a dedicated file system, which is normally
+of a dedicated filesystem, which is normally
mounted under
.IR /dev/shm .
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR close (2),
.BR fchmod (2),
.BR fchown (2),
.BR fcntl (2),
.BR fstat (2),
.BR ftruncate (2),
+.BR memfd_create (2),
.BR mmap (2),
.BR open (2),
.BR umask (2),
.BR shm_overview (7)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.