.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 
.TH "<sys/shm.h>" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
.\" <sys/shm.h> 
.SH NAME
sys/shm.h \- XSI shared memory facility
.SH SYNOPSIS
.LP
\fB#include <sys/shm.h> \fP
.SH DESCRIPTION
.LP
The \fI<sys/shm.h>\fP header shall define the following symbolic constants:
.TP 7
SHM_RDONLY
Attach read-only (else read-write).
.TP 7
SHM_RND
Round attach address to SHMLBA.
.sp
.LP
The \fI<sys/shm.h>\fP header shall define the following symbolic value:
.TP 7
SHMLBA
Segment low boundary address multiple.
.sp
.LP
The following data types shall be defined through \fBtypedef\fP:
.TP 7
\fBshmatt_t\fP
Unsigned integer used for the number of current attaches that must
be able to store values at least as large as a type
\fBunsigned short\fP.
.sp
.LP
The \fBshmid_ds\fP structure shall contain the following members:
.sp
.RS
.nf

\fBstruct ipc_perm shm_perm  \fP Operation permission structure. \fB
size_t          shm_segsz \fP Size of segment in bytes. \fB
pid_t           shm_lpid  \fP Process ID of last shared memory operation. \fB
pid_t           shm_cpid  \fP Process ID of creator. \fB
shmatt_t        shm_nattch\fP Number of current attaches. \fB
time_t          shm_atime \fP Time of last \fIshmat\fP
 (). \fB
time_t          shm_dtime \fP Time of last \fIshmdt\fP
 (). \fB
time_t          shm_ctime \fP Time of last change by \fIshmctl\fP
 (). \fB
\fP
.fi
.RE
.LP
The \fBpid_t\fP, \fBtime_t\fP, \fBkey_t\fP, and \fBsize_t\fP types
shall be defined as described in \fI<sys/types.h>\fP .
.LP
The following shall be declared as functions and may also be defined
as macros. Function prototypes shall be provided.
.sp
.RS
.nf

\fBvoid *shmat(int, const void *, int);
int   shmctl(int, int, struct shmid_ds *);
int   shmdt(const void *);
int   shmget(key_t, size_t, int);
\fP
.fi
.RE
.LP
In addition, all of the symbols from \fI<sys/ipc.h>\fP shall be defined
when
this header is included.
.LP
\fIThe following sections are informative.\fP
.SH APPLICATION USAGE
.LP
None.
.SH RATIONALE
.LP
None.
.SH FUTURE DIRECTIONS
.LP
None.
.SH SEE ALSO
.LP
\fI<sys/ipc.h>\fP , \fI<sys/types.h>\fP , the System Interfaces volume
of IEEE\ Std\ 1003.1-2001, \fIshmat\fP(), \fIshmctl\fP(), \fIshmdt\fP(),
\fIshmget\fP()
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. In the
event of any discrepancy between this version and the original IEEE and
The Open Group Standard, the original IEEE and The Open Group Standard
is the referee document. The original Standard can be obtained online at
http://www.opengroup.org/unix/online.html .
