Index: stable/10/lib/libc/sys/msgget.2 =================================================================== --- stable/10/lib/libc/sys/msgget.2 (revision 330800) +++ stable/10/lib/libc/sys/msgget.2 (revision 330801) @@ -1,141 +1,154 @@ .\" $NetBSD: msgget.2,v 1.1 1995/10/16 23:49:19 jtc Exp $ .\" .\" Copyright (c) 1995 Frank van der Linden .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed for the NetBSD Project .\" by Frank van der Linden .\" 4. The name of the author may not be used to endorse or promote products .\" derived from this software without specific prior written permission .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" $FreeBSD$ .\" .\"/ -.Dd July 9, 2009 +.Dd March 4, 2018 .Dt MSGGET 2 .Os .Sh NAME .Nm msgget .Nd get message queue .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h -.In sys/ipc.h .In sys/msg.h .Ft int .Fn msgget "key_t key" "int msgflg" .Sh DESCRIPTION The .Fn msgget function returns the message queue identifier associated with .Fa key . A message queue identifier is a unique integer greater than zero. .Pp A message queue is created if either .Fa key is equal to .Dv IPC_PRIVATE , or .Fa key does not have a message queue identifier associated with it, and the .Dv IPC_CREAT bit is set in .Fa msgflg . .Pp If a new message queue is created, the data structure associated with it (the .Va msqid_ds structure, see .Xr msgctl 2 ) is initialized as follows: .Bl -bullet .It .Va msg_perm.cuid and .Va msg_perm.uid are set to the effective uid of the calling process. .It .Va msg_perm.gid and .Va msg_perm.cgid are set to the effective gid of the calling process. .It .Va msg_perm.mode is set to the lower 9 bits of -.Fa msgflg . +.Fa msgflg +which are set by ORing these constants: +.Bl -tag -width 0000 +.It Dv 0400 +Read access for user. +.It Dv 0200 +Write access for user. +.It Dv 0040 +Read access for group. +.It Dv 0020 +Write access for group. +.It Dv 0004 +Read access for other. +.It Dv 0002 +Write access for other. +.El .It .Va msg_cbytes , .Va msg_qnum , .Va msg_lspid , .Va msg_lrpid , .Va msg_rtime , and .Va msg_stime are set to 0. .It .Va msg_qbytes is set to the system wide maximum value for the number of bytes in a queue .Pf ( Dv MSGMNB ) . .It .Va msg_ctime is set to the current time. .El .Sh RETURN VALUES Upon successful completion a positive message queue identifier is returned. Otherwise, -1 is returned and the global variable .Va errno is set to indicate the error. .Sh ERRORS .Bl -tag -width Er .It Bq Er EACCES A message queue is already associated with .Fa key and the caller has no permission to access it. .It Bq Er EEXIST Both .Dv IPC_CREAT and .Dv IPC_EXCL are set in .Fa msgflg , and a message queue is already associated with .Fa key . .It Bq Er ENOSPC A new message queue could not be created because the system limit for the number of message queues has been reached. .It Bq Er ENOENT .Dv IPC_CREAT was not set in .Fa msgflg and no message queue associated with .Fa key was found. .El .Sh SEE ALSO .Xr msgctl 2 , .Xr msgrcv 2 , .Xr msgsnd 2 .Sh HISTORY Message queues appeared in the first release of .At V . Index: stable/10/lib/libc/sys/semget.2 =================================================================== --- stable/10/lib/libc/sys/semget.2 (revision 330800) +++ stable/10/lib/libc/sys/semget.2 (revision 330801) @@ -1,159 +1,156 @@ .\" .\" Copyright (c) 1995 David Hovemeyer .\" .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd February 7, 2016 +.Dd March 4, 2018 .Dt SEMGET 2 .Os .Sh NAME .Nm semget .Nd obtain a semaphore id .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h -.In sys/ipc.h .In sys/sem.h .Ft int .Fn semget "key_t key" "int nsems" "int flag" .Sh DESCRIPTION Based on the values of .Fa key and .Fa flag , .Fn semget returns the identifier of a newly created or previously existing set of semaphores. .\" .\" This is copied verbatim from the shmget manpage. Perhaps .\" it should go in a common manpage, such as .Xr ipc 2 .\" The key is analogous to a filename: it provides a handle that names an IPC object. There are three ways to specify a key: .Bl -bullet .It IPC_PRIVATE may be specified, in which case a new IPC object will be created. .It An integer constant may be specified. If no IPC object corresponding to .Fa key is specified and the IPC_CREAT bit is set in .Fa flag , a new one will be created. .It The .Xr ftok 3 function may be used to generate a key from a pathname. .El .\" .\" Likewise for this section, except SHM_* becomes SEM_*. .\" .Pp -The mode of a newly created IPC object is determined by -.Em OR Ns 'ing -the following constants into the +The mode of a newly created IPC object is determined by ORing these constants +into the .Fa flag argument: -.Bl -tag -width XSEM_WXX6XXX -.It Dv SEM_R +.Bl -tag -width 0000 +.It Dv 0400 Read access for user. -.It Dv SEM_A +.It Dv 0200 Alter access for user. -.It Dv ( SEM_R>>3 ) +.It Dv 0040 Read access for group. -.It Dv ( SEM_A>>3 ) +.It Dv 0020 Alter access for group. -.It Dv ( SEM_R>>6 ) +.It Dv 0004 Read access for other. -.It Dv ( SEM_A>>6 ) +.It Dv 0002 Alter access for other. .El .Pp If a new set of semaphores is being created, .Fa nsems is used to indicate the number of semaphores the set should contain. Otherwise, .Fa nsems may be specified as 0. .Sh RETURN VALUES The .Fn semget system call returns the id of a semaphore set if successful; otherwise, -1 is returned and .Va errno is set to indicate the error. .Sh ERRORS The .Fn semget system call will fail if: .Bl -tag -width Er .\" ipcperm could fail (we are opening to read and write, as it were) .It Bq Er EACCES Access permission failure. .\" .\" sysv_sem.c is quite explicit about these, so I'm pretty sure .\" this is accurate .\" .It Bq Er EEXIST IPC_CREAT and IPC_EXCL were specified, and a semaphore set corresponding to .Fa key already exists. .It Bq Er EINVAL The number of semaphores requested exceeds the system imposed maximum per set. .It Bq Er EINVAL A semaphore set corresponding to .Fa key already exists and contains fewer semaphores than .Fa nsems . .It Bq Er EINVAL A semaphore set corresponding to .Fa key does not exist and .Fa nsems is 0 or negative. .It Bq Er ENOSPC Insufficiently many semaphores are available. .It Bq Er ENOSPC The kernel could not allocate a .Fa "struct semid_ds" . .It Bq Er ENOENT No semaphore set was found corresponding to .Fa key , and IPC_CREAT was not specified. .El .Sh SEE ALSO .Xr semctl 2 , .Xr semop 2 , .Xr ftok 3 Index: stable/10/lib/libc/sys/shmget.2 =================================================================== --- stable/10/lib/libc/sys/shmget.2 (revision 330800) +++ stable/10/lib/libc/sys/shmget.2 (revision 330801) @@ -1,146 +1,142 @@ .\" .\" Copyright (c) 1995 David Hovemeyer .\" .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd December 17, 2010 +.Dd March 4, 2018 .Dt SHMGET 2 .Os .Sh NAME .Nm shmget .Nd obtain a shared memory identifier .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h -.In sys/ipc.h .In sys/shm.h .Ft int .Fn shmget "key_t key" "size_t size" "int flag" .Sh DESCRIPTION Based on the values of .Fa key and .Fa flag , .Fn shmget returns the identifier of a newly created or previously existing shared memory segment. .\" .\" The following bit about keys and modes also applies to semaphores .\" and message queues. .\" The key is analogous to a filename: it provides a handle that names an IPC object. There are three ways to specify a key: .Bl -bullet .It IPC_PRIVATE may be specified, in which case a new IPC object will be created. .It An integer constant may be specified. If no IPC object corresponding to .Fa key is specified and the IPC_CREAT bit is set in .Fa flag , a new one will be created. .It The .Xr ftok 3 may be used to generate a key from a pathname. .El .Pp The mode of a newly created IPC object is determined by -.Em OR Ns 'ing -the following constants into the +which are set by ORing these constants into the .Fa flag argument: -.Bl -tag -width XSHM_WXX6XXX -.It Dv S_IRUSR +.Bl -tag -width 0000 +.It Dv 0400 Read access for owner. -.It Dv S_IWUSR +.It Dv 0200 Write access for owner. -.It Dv S_IRGRP +.It Dv 0040 Read access for group. -.It Dv S_IWGRP +.It Dv 0020 Write access for group. -.It Dv S_IROTH +.It Dv 0004 Read access for other. -.It Dv S_IWOTH +.It Dv 0002 Write access for other. .El .\" .\" XXX - we should also mention how uid, euid, and gid affect ownership .\" and use .\" .\" end section about keys and modes .\" .Pp When creating a new shared memory segment, .Fa size indicates the desired size of the new segment in bytes. The size of the segment may be rounded up to a multiple convenient to the kernel (i.e., the page size). .Sh RETURN VALUES Upon successful completion, .Fn shmget returns the positive integer identifier of a shared memory segment. Otherwise, -1 is returned and .Va errno set to indicate the error. .Sh ERRORS The .Fn shmget system call will fail if: .Bl -tag -width Er .\" .\" XXX What about ipcperm failing? .\" .It Bq Er EINVAL Size specified is greater than the size of the previously existing segment. Size specified is less than the system imposed minimum, or greater than the system imposed maximum. .It Bq Er ENOENT No shared memory segment was found matching .Fa key , and IPC_CREAT was not specified. .It Bq Er ENOSPC The kernel was unable to allocate enough memory to satisfy the request. .It Bq Er EEXIST IPC_CREAT and IPC_EXCL were specified, and a shared memory segment corresponding to .Fa key already exists. .El .Sh "SEE ALSO" .Xr shmat 2 , .Xr shmctl 2 , .Xr shmdt 2 , -.Xr stat 2 , .Xr ftok 3 Index: stable/10 =================================================================== --- stable/10 (revision 330800) +++ stable/10 (revision 330801) Property changes on: stable/10 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r330409