|
|
1.1 root 1: .TH MSGCTL 2
2: .SH NAME
3: msgctl \- message control operations
4: .SH SYNOPSIS
5: .B #include <sys/types.h>
6: .br
7: .B #include <sys/ipc.h>
8: .br
9: .B #include <sys/msg.h>
10: .PP
11: .nf
12: .B int msgctl (msqid, cmd, buf)
13: .B int msqid, cmd;
14: .B struct msqid_ds \(**buf;
15: .fi
16: .SH DESCRIPTION
17: .I Msgctl
18: provides a variety of message control operations as specified by
19: .IR cmd .
20: The following
21: .IR cmd s
22: are available:
23: .TP 15
24: .SM
25: .B IPC_STAT
26: Place the current value of each member of the data structure associated with
27: .I msqid
28: into the structure pointed to by
29: .IR buf .
30: The contents of this structure are defined in
31: .IR intro (2).
32: .SM {READ}
33: .TP
34: .SM
35: .B IPC_SET
36: Set the value of the following members of the data structure associated with
37: .I msqid
38: to the corresponding value found in the structure pointed to by
39: .IR buf :
40: .RS
41: .RS
42: .nf
43: msg_perm.uid
44: msg_perm.gid
45: msg_perm.mode /\(** only low 9 bits \(**/
46: msg_qbytes
47: .fi
48: .RE
49: .RE
50: .IP
51: This \fIcmd\fP can only be executed by a process that has an effective user
52: .SM ID
53: equal to either that of super user or to the value of
54: .B msg_perm.uid
55: in the data structure associated with
56: .IR msqid .
57: Only super user can raise the value of
58: .BR msg_qbytes .
59: .TP
60: .SM
61: .B IPC_RMID
62: Remove the message queue identifier specified by
63: .I msqid
64: from the system and destroy the message queue and data structure
65: associated with it.
66: This \fIcmd\fP can only be executed by a process that has an effective user
67: .SM ID
68: equal to either that of super user or to the value of
69: .B msg_perm.uid
70: in the data structure associated with
71: .IR msqid .
72: .PP
73: .I Msgctl
74: will fail if one or more of the following are true:
75: .TP 15
76: .TP
77: \s-1\%[EINVAL]\s+1
78: .I Msqid
79: is not a valid message queue identifier.
80: .TP
81: \s-1\%[EINVAL]\s+1
82: .I Cmd
83: is not a valid command.
84: .TP
85: \s-1\%[EACCES]\s+1
86: .I Cmd
87: is equal to
88: .SM
89: .B IPC_STAT
90: and
91: .SM {READ}
92: operation permission is denied to the calling process (see
93: .IR intro (2)).
94: .TP
95: \s-1\%[EPERM]\s+1
96: .I Cmd
97: is equal to
98: .SM
99: .B IPC_RMID
100: or
101: .SM
102: .BR IPC_SET .
103: The effective user
104: .SM ID
105: of the calling process is not equal to that of super user and it is
106: not equal to the value of
107: .B msg_perm.uid
108: in the data structure associated with
109: .IR msqid .
110: .TP
111: \s-1\%[EPERM]\s+1
112: .I Cmd
113: is equal to
114: .SM
115: .BR IPC_SET\*S,
116: an attempt is being made to increase to the value of
117: .BR msg_qbytes,
118: and the effective user
119: .SM ID
120: of the calling process is not equal to that of super user.
121: .TP
122: \s-1\%[EFAULT]\s+1
123: .I Buf
124: points to an illegal address.
125: .SH "RETURN VALUE"
126: Upon successful completion, a value of 0 is returned. Otherwise, a
127: value of \-1 is returned and
128: .I errno\^
129: is set to indicate the error.
130: .SH SEE ALSO
131: intro(2), msgget(2), msgop(2).
132: .\" @(#)msgctl.2 6.2 of 9/6/83
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.