Update for XSH5.

This commit is contained in:
thorpej 1999-08-25 21:12:54 +00:00
parent 6516d0b239
commit df6731425c
3 changed files with 54 additions and 49 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: shmat.2,v 1.8 1999/03/22 19:45:09 garbled Exp $
.\" $NetBSD: shmat.2,v 1.9 1999/08/25 21:12:54 thorpej Exp $
.\"
.\" Copyright (c) 1995 Frank van der Linden
.\" All rights reserved.
@ -29,7 +29,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd August 17, 1995
.Dd August 25, 1999
.Dt SHMAT 2
.Os
.Sh NAME
@ -37,8 +37,6 @@
.Nm shmdt
.Nd map/unmap shared memory
.Sh SYNOPSIS
.Fd #include <sys/types.h>
.Fd #include <sys/ipc.h>
.Fd #include <sys/shm.h>
.Ft void *
.Fn shmat "int shmid" "const void *shmaddr" "int shmflg"
@ -123,3 +121,13 @@ is not the start address of a mapped shared memory segment.
.Xr mmap 2 ,
.Xr shmctl 2 ,
.Xr shmget 2
.Sh STANDARDS
The
.Nm shmat
and
.Nm shmdt
system calls conform to
.St -xsh5 .
.Sh HISTORY
Shared memory segments appeared in the first release of
.At V .

View File

@ -1,4 +1,4 @@
.\" $NetBSD: shmctl.2,v 1.7 1999/03/22 19:45:09 garbled Exp $
.\" $NetBSD: shmctl.2,v 1.8 1999/08/25 21:12:54 thorpej Exp $
.\"
.\" Copyright (c) 1995 Frank van der Linden
.\" All rights reserved.
@ -29,67 +29,50 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd August 17, 1995
.Dd August 25, 1999
.Dt SHMCTL 2
.Os
.Sh NAME
.Nm shmctl
.Nd shared memory control operations
.Sh SYNOPSIS
.Fd #include <sys/types.h>
.Fd #include <sys/ipc.h>
.Fd #include <sys/shm.h>
.Ft int
.Fn shmctl "int shmid" "int cmd" "struct shmid_ds *buf"
.Sh DESCRIPTION
The
.Fn shmctl
system call performs some control operations on the shared memory area
system call performs control operations on the shared memory segment
specified by
.Fa shmid .
.Pp
Each shared memory segment has a data structure associated with it,
parts of which may be altered by
.Fn shmctl
and parts of which determine the actions of
.Fn shmctl .
.Pp
This structure is defined as follows in
.Aq Pa sys/shm.h :
Each shared memory segment has a
.Sy shmid_ds
structure associated with it which contains the following members:
.Bd -literal
struct shmid_ds {
struct ipc_perm shm_perm; /* operation permissions */
int shm_segsz; /* size of segment in bytes */
pid_t shm_lpid; /* pid of last shm op */
pid_t shm_cpid; /* pid of creator */
short shm_nattch; /* # of current attaches */
time_t shm_atime; /* last shmat() time*/
time_t shm_dtime; /* last shmdt() time */
time_t shm_ctime; /* last change by shmctl() */
void *shm_internal; /* sysv stupidity */
};
struct ipc_perm shm_perm; /* operation permissions */
size_t shm_segsz; /* size of segment in bytes */
pid_t shm_lpid; /* pid of last shm op */
pid_t shm_cpid; /* pid of creator */
shmatt_t shm_nattch; /* # of current attaches */
time_t shm_atime; /* last shmat() time*/
time_t shm_dtime; /* last shmdt() time */
time_t shm_ctime; /* last change by shmctl() */
.Ed
.Pp
The
.Bf -literal
ipc_perm
.Ef
.Sy ipc_perm
structure used inside the
.Bf -literal
shmid_ds
.Ef
.Sy shmid_ds
structure is defined in
.Aq Pa sys/ipc.h
and looks like this:
and contains the following members:
.Bd -literal
struct ipc_perm {
ushort cuid; /* creator user id */
ushort cgid; /* creator group id */
ushort uid; /* user id */
ushort gid; /* group id */
ushort mode; /* r/w permission (see chmod(2)) */
ushort seq; /* sequence # (to generate unique msg/sem/shm id) */
key_t key; /* user specified msg/sem/shm key */
};
uid_t cuid; /* creator user id */
gid_t cgid; /* creator group id */
uid_t uid; /* user id */
gid_t gid; /* group id */
mode_t mode; /* permission (lower 9 bits) */
.Ed
.Pp
The operation to be performed by
@ -189,3 +172,11 @@ specifies an invalid address.
.Sh SEE ALSO
.Xr shmat 2 ,
.Xr shmget 2
.Sh STANDARDS
The
.Nm
system call conforms to
.St -xsh5 .
.Sh HISTORY
Shared memory segments appeared in the first release of
.At V .

View File

@ -1,4 +1,4 @@
.\" $NetBSD: shmget.2,v 1.6 1999/03/22 19:45:09 garbled Exp $
.\" $NetBSD: shmget.2,v 1.7 1999/08/25 21:12:54 thorpej Exp $
.\"
.\" Copyright (c) 1995 Frank van der Linden
.\" All rights reserved.
@ -29,15 +29,13 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd August 17, 1995
.Dd August 25, 1999
.Dt SHMGET 2
.Os
.Sh NAME
.Nm shmget
.Nd get shared memory area identifier
.Nd get shared memory segment
.Sh SYNOPSIS
.Fd #include <sys/types.h>
.Fd #include <sys/ipc.h>
.Fd #include <sys/shm.h>
.Ft int
.Fn shmget "key_t key" "size_t size" "int shmflg"
@ -132,3 +130,11 @@ requested size.
.Xr mmap 2 ,
.Xr shmat 2 ,
.Xr shmctl 2
.Sh STANDARDS
The
.Nm
system call conforms to
.St -xsh5 .
.Sh HISTORY
Shared memory segments appeared in the first release of
.At V .