⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msgget.2

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 2
字号:
.\" SCCSID: @(#)msgget.2	8.2	3/28/91.TH msgget 2.SH Namemsgget \- get message queue.SH Syntax.nf.ft B#include <sys/types.h>#include <sys/ipc.h>#include <sys/msg.h>.PP.ft Bint msgget (key, msgflg)key_t key;int msgflg;.fi.SH Description.NXR "msgget system call" .NXA "msgget system call" "ftok subroutine".NXA "msgget system call" "msgsnd system call".NXR "message" "getting queue identifier"The.PN msggetsystem callreturns the message queue identifier associated with.I key..PPA message queue identifier and associated message queue and datastructure are created for.I key if one of the following is true:.IP \(bu 5The.I keyis equal to IPC_PRIVATE.IP \(bu 5The.I keydoes not already have a message queue identifier associated with it,and.IR (msgflg& IPC_CREAT)is true.For further information, see .MS intro 2 . .PPUpon creation, the data structure associated with the new message queueidentifier is initialized as follows:.IP \(bu 5The.IR msg_perm.cuid,.IR msg_perm.uid,.I msg_perm.cgidand .I msg_perm.gidmembersare set equal to the effective user ID and effective group ID,respectively, of the calling process..IP \(bu 5The low-order nine bits of.I msg_perm.modeare set equal to the low-order nine bits of.I msgflg..IP \(bu 5The.IR msg_qnum ,.IR msg_lspid ,.IR msg_lrpid ,.IR msg_stime ,and.I mgs_rtimemembers are set equal to 0..IP \(bu 5The.I msg_ctimeis set equal to the current time..IP \(bu 5The.I msg_qbytesis set equal to the system limit..SH Return ValuesUpon successful completion, a non-negative integer, which is a messagequeue identifier, is returned.  Otherwise, a value of \-1 is returned, and.I errnois set to indicate the error..SH Diagnostics.NXR "msgget system call" "diagnostics"The.PN msggetsystem callfails under the following conditions: .TP 15[EACCES]A message queue identifier exists for.I keybut operations permission, as specified by the low-order nine bits of.I msgflg,would not be granted. For further information, see .MS intro 2 ..TP 15[ENOENT]A message queue identifier does not exist for.I keyand the logical operation.IR (msgflg& IPC_CREAT)is false. .TP 15[ENOSPC]A message queue identifier is to be created, but the system-imposedlimit on the maximum number of allowed message queueidentifiers system wide would be exceeded. .TP 15[EEXIST]A message queue identifier exists for.I keybut the logical operation .RI (( msgflg&IPC_CREAT )&.RI ( msgflg& IPC_EXCL ))is true. .SH See Alsomsgctl(2), msgop(2), ftok(3)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -