diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2019-07-18 13:32:41 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2019-07-18 13:32:41 +0000 |
commit | 6fd992f3f30b6a40db56365b9dc4a9595b307dff (patch) | |
tree | 5225e0c4fb48e38dba5a11cec25509db4a739362 /lib | |
parent | 465b56ed8b97337a6bf24a28a517b89daf4e6d3e (diff) |
add STANDARDS, improve HISTORY, and basic macro cleanup:
use .Vt for struct names and and .Fa for struct fields
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/sys/msgctl.2 | 57 | ||||
-rw-r--r-- | lib/libc/sys/msgget.2 | 43 | ||||
-rw-r--r-- | lib/libc/sys/msgrcv.2 | 29 |
3 files changed, 75 insertions, 54 deletions
diff --git a/lib/libc/sys/msgctl.2 b/lib/libc/sys/msgctl.2 index ed40da3cde2..f14360ea504 100644 --- a/lib/libc/sys/msgctl.2 +++ b/lib/libc/sys/msgctl.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: msgctl.2,v 1.17 2014/12/10 19:19:00 schwarze Exp $ +.\" $OpenBSD: msgctl.2,v 1.18 2019/07/18 13:32:40 schwarze Exp $ .\" $NetBSD: msgctl.2,v 1.2 1997/03/27 08:20:35 mikel Exp $ .\" .\" Copyright (c) 1995 Frank van der Linden @@ -30,7 +30,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 $Mdocdate: December 10 2014 $ +.Dd $Mdocdate: July 18 2019 $ .Dt MSGCTL 2 .Os .Sh NAME @@ -70,9 +70,9 @@ struct msqid_ds { .Ed .Pp The -.Fa ipc_perm +.Vt ipc_perm structure used inside the -.Fa msqid_ds +.Vt msqid_ds structure is defined in .In sys/ipc.h and looks like this: @@ -100,11 +100,11 @@ structure pointed to by .Fa buf . .It Dv IPC_SET Set the value of the -.Va msg_perm.uid , -.Va msg_perm.gid , -.Va msg_perm.mode +.Fa msg_perm.uid , +.Fa msg_perm.gid , +.Fa msg_perm.mode and -.Va msg_qbytes +.Fa msg_qbytes fields in the structure associated with .Fa msqid . The values are taken from the corresponding fields in the structure @@ -112,15 +112,15 @@ pointed to by .Fa buf . This operation can only be executed by the superuser, or a process that has an effective user ID equal to either -.Va msg_perm.cuid +.Fa msg_perm.cuid or -.Va msg_perm.uid +.Fa msg_perm.uid in the data structure associated with the message queue. The value of -.Va msg_qbytes +.Fa msg_qbytes can only be increased by the superuser. Values for -.Va msg_qbytes +.Fa msg_qbytes that exceed the system limit .Pf ( Dv MSGMNB from @@ -131,9 +131,9 @@ Remove the message queue specified by .Fa msqid and destroy the data associated with it. Only the superuser or a process with an effective UID equal to the -.Va msg_perm.cuid +.Fa msg_perm.cuid or -.Va msg_perm.uid +.Fa msg_perm.uid values in the data structure associated with the queue can do this. .El .Pp @@ -142,19 +142,19 @@ The permission to read from or write to a message queue (see and .Xr msgrcv 2 ) is determined by the -.Va msg_perm.mode +.Fa msg_perm.mode field in the same way as is done with files (see .Xr chmod 2 ) , but the effective UID can match either the -.Va msg_perm.cuid +.Fa msg_perm.cuid field or the -.Va msg_perm.uid +.Fa msg_perm.uid field, and the effective GID can match either -.Va msg_perm.cgid +.Fa msg_perm.cgid or -.Va msg_perm.gid . +.Fa msg_perm.gid . .Sh RETURN VALUES .Rv -std .Sh ERRORS @@ -169,13 +169,13 @@ or .Dv IPC_RMID and the caller is not the superuser, nor does the effective UID match either the -.Va msg_perm.uid +.Fa msg_perm.uid or -.Va msg_perm.cuid +.Fa msg_perm.cuid fields of the data structure associated with the message queue. .Pp An attempt is made to increase the value of -.Va msg_qbytes +.Fa msg_qbytes through .Dv IPC_SET but the caller is not the superuser. @@ -187,7 +187,7 @@ and the caller has no read permission for this message queue. .Fa msqid is not a valid message queue identifier. .Pp -.Va cmd +.Fa cmd is not a valid command. .It Bq Er EFAULT .Fa buf @@ -197,6 +197,13 @@ specifies an invalid address. .Xr msgget 2 , .Xr msgrcv 2 , .Xr msgsnd 2 +.Sh STANDARDS +The +.Fn msgctl +function conforms to the X/Open System Interfaces option of +.St -p1003.1-2008 . .Sh HISTORY -Message queues appeared in -.At V.1 . +Message queues first appeared in +.At V.1 +and have been available since +.Nx 1.0 . diff --git a/lib/libc/sys/msgget.2 b/lib/libc/sys/msgget.2 index d5f56478723..1fb3a99faba 100644 --- a/lib/libc/sys/msgget.2 +++ b/lib/libc/sys/msgget.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: msgget.2,v 1.13 2014/11/15 22:19:53 guenther Exp $ +.\" $OpenBSD: msgget.2,v 1.14 2019/07/18 13:32:40 schwarze Exp $ .\" $NetBSD: msgget.2,v 1.1 1995/10/16 23:49:19 jtc Exp $ .\" .\" Copyright (c) 1995 Frank van der Linden @@ -30,7 +30,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 $Mdocdate: November 15 2014 $ +.Dd $Mdocdate: July 18 2019 $ .Dt MSGGET 2 .Os .Sh NAME @@ -58,40 +58,40 @@ bit is set in .Fa msgflg . .Pp If a new message queue is created, the data structure associated with it (the -.Va msqid_ds +.Vt msqid_ds structure, see .Xr msgctl 2 ) is initialized as follows: .Bl -bullet .It -.Va msg_perm.cuid +.Fa msg_perm.cuid and -.Va msg_perm.uid +.Fa msg_perm.uid are set to the effective UID of the calling process. .It -.Va msg_perm.gid +.Fa msg_perm.gid and -.Va msg_perm.cgid +.Fa msg_perm.cgid are set to the effective GID of the calling process. .It -.Va msg_perm.mode +.Fa msg_perm.mode is set to the lower 9 bits of .Fa msgflg . .It -.Va msg_cbytes , -.Va msg_qnum , -.Va msg_lspid , -.Va msg_lrpid , -.Va msg_rtime , +.Fa msg_cbytes , +.Fa msg_qnum , +.Fa msg_lspid , +.Fa msg_lrpid , +.Fa msg_rtime , and -.Va msg_stime +.Fa msg_stime are set to 0. .It -.Va msg_qbytes +.Fa msg_qbytes is set to the system wide maximum value for the number of bytes in a queue .Pq Dv MSGMNB . .It -.Va msg_ctime +.Fa msg_ctime is set to the current time. .El .Sh RETURN VALUES @@ -130,6 +130,13 @@ was found. .Xr msgrcv 2 , .Xr msgsnd 2 , .Xr ftok 3 +.Sh STANDARDS +The +.Fn msgget +function conforms to the X/Open System Interfaces option of +.St -p1003.1-2008 . .Sh HISTORY -Message queues appeared in -.At V.1 . +Message queues first appeared in +.At V.1 +and have been available since +.Nx 1.0 . diff --git a/lib/libc/sys/msgrcv.2 b/lib/libc/sys/msgrcv.2 index ee89c1ace4b..d49ed306be2 100644 --- a/lib/libc/sys/msgrcv.2 +++ b/lib/libc/sys/msgrcv.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: msgrcv.2,v 1.16 2014/11/15 22:19:53 guenther Exp $ +.\" $OpenBSD: msgrcv.2,v 1.17 2019/07/18 13:32:40 schwarze Exp $ .\" $NetBSD: msgrcv.2,v 1.2 1997/03/27 08:20:37 mikel Exp $ .\" .\" Copyright (c) 1995 Frank van der Linden @@ -30,7 +30,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 $Mdocdate: November 15 2014 $ +.Dd $Mdocdate: July 18 2019 $ .Dt MSGRCV 2 .Os .Sh NAME @@ -53,9 +53,9 @@ This structure should consist of the following members: char mtext[1]; /* body of message */ .Ed .Pp -.Va mtype +.Fa mtype is an integer greater than 0 that can be used for selecting messages, -.Va mtext +.Fa mtext is an array of bytes, with a size up to that of the system limit .Pq Dv MSGMAX . .Pp @@ -134,23 +134,23 @@ If a message is successfully received, the data structure associated with is updated as follows: .Bl -bullet .It -.Va msg_cbytes +.Fa msg_cbytes is decremented by the size of the message. .It -.Va msg_lrpid +.Fa msg_lrpid is set to the pid of the caller. .It -.Va msg_lrtime +.Fa msg_lrtime is set to the current time. .It -.Va msg_qnum +.Fa msg_qnum is decremented by 1. .El .Sh RETURN VALUES Upon successful completion, .Fn msgrcv returns the number of bytes received into the -.Va mtext +.Fa mtext field of the structure pointed to by .Fa msgp . Otherwise, \-1 is returned, and @@ -195,6 +195,13 @@ was waiting for a message of the requested type to become available on it. .Xr msgctl 2 , .Xr msgget 2 , .Xr msgsnd 2 +.Sh STANDARDS +The +.Fn msgrcv +function conforms to the X/Open System Interfaces option of +.St -p1003.1-2008 . .Sh HISTORY -Message queues appeared in -.At V.1 . +Message queues first appeared in +.At V.1 +and have been available since +.Nx 1.0 . |