| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: semctl.2,v 1.17 2008/05/06 20:25:09 njoly Exp $ | | 1 | .\" $NetBSD: semctl.2,v 1.18 2009/06/21 17:52:42 dholland Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 1995 Frank van der Linden | | 3 | .\" Copyright (c) 1995 Frank van der Linden |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" Redistribution and use in source and binary forms, with or without | | 6 | .\" Redistribution and use in source and binary forms, with or without |
7 | .\" modification, are permitted provided that the following conditions | | 7 | .\" modification, are permitted provided that the following conditions |
8 | .\" are met: | | 8 | .\" are met: |
9 | .\" 1. Redistributions of source code must retain the above copyright | | 9 | .\" 1. Redistributions of source code must retain the above copyright |
10 | .\" notice, this list of conditions and the following disclaimer. | | 10 | .\" notice, this list of conditions and the following disclaimer. |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright |
12 | .\" notice, this list of conditions and the following disclaimer in the | | 12 | .\" notice, this list of conditions and the following disclaimer in the |
13 | .\" documentation and/or other materials provided with the distribution. | | 13 | .\" documentation and/or other materials provided with the distribution. |
14 | .\" 3. All advertising materials mentioning features or use of this software | | 14 | .\" 3. All advertising materials mentioning features or use of this software |
| @@ -140,39 +140,39 @@ and | | | @@ -140,39 +140,39 @@ and |
140 | fields in the structure associated with the semaphore. | | 140 | fields in the structure associated with the semaphore. |
141 | The values are taken from the corresponding fields in the structure | | 141 | The values are taken from the corresponding fields in the structure |
142 | pointed to by | | 142 | pointed to by |
143 | .Fa arg.buf , | | 143 | .Fa arg.buf , |
144 | there | | 144 | there |
145 | .Fa arg | | 145 | .Fa arg |
146 | is the fourth argument to | | 146 | is the fourth argument to |
147 | .Fn semctl . | | 147 | .Fn semctl . |
148 | This operation can only be executed by the super-user, or a process that | | 148 | This operation can only be executed by the super-user, or a process that |
149 | has an effective user id equal to either | | 149 | has an effective user id equal to either |
150 | .Va sem_perm.cuid | | 150 | .Va sem_perm.cuid |
151 | or | | 151 | or |
152 | .Va sem_perm.uid | | 152 | .Va sem_perm.uid |
153 | in the data structure associated with the message queue. | | 153 | in the data structure associated with the semaphore. |
154 | .It Dv IPC_RMID | | 154 | .It Dv IPC_RMID |
155 | Remove the semaphores associated with | | 155 | Remove the semaphores associated with |
156 | .Fa semid | | 156 | .Fa semid |
157 | from the system and destroy the data structures associated with it. | | 157 | from the system and destroy the data structures associated with it. |
158 | Only the super-user or a process with an effective uid equal to the | | 158 | Only the super-user or a process with an effective uid equal to the |
159 | .Va sem_perm.cuid | | 159 | .Va sem_perm.cuid |
160 | or | | 160 | or |
161 | .Va sem_perm.uid | | 161 | .Va sem_perm.uid |
162 | values in the data structure associated with the semaphore can do this. | | 162 | values in the data structure associated with the semaphore can do this. |
163 | .El | | 163 | .El |
164 | .Pp | | 164 | .Pp |
165 | The permission to read or change a message queue (see | | 165 | The permission to read or change a semaphore (see |
166 | .Xr semop 2 ) | | 166 | .Xr semop 2 ) |
167 | is determined by the | | 167 | is determined by the |
168 | .Va sem_perm.mode | | 168 | .Va sem_perm.mode |
169 | field in the same way as is | | 169 | field in the same way as is |
170 | done with files (see | | 170 | done with files (see |
171 | .Xr chmod 2 ) , | | 171 | .Xr chmod 2 ) , |
172 | but the effective uid can match either the | | 172 | but the effective uid can match either the |
173 | .Va sem_perm.cuid | | 173 | .Va sem_perm.cuid |
174 | field or the | | 174 | field or the |
175 | .Va sem_perm.uid | | 175 | .Va sem_perm.uid |
176 | field, and the | | 176 | field, and the |
177 | effective gid can match either | | 177 | effective gid can match either |
178 | .Va sem_perm.cgid | | 178 | .Va sem_perm.cgid |
| @@ -199,27 +199,27 @@ set to reflect the error. | | | @@ -199,27 +199,27 @@ set to reflect the error. |
199 | will fail if: | | 199 | will fail if: |
200 | .Bl -tag -width Er | | 200 | .Bl -tag -width Er |
201 | .It Bq Er EPERM | | 201 | .It Bq Er EPERM |
202 | .Fa cmd | | 202 | .Fa cmd |
203 | is equal to | | 203 | is equal to |
204 | .Dv IPC_SET | | 204 | .Dv IPC_SET |
205 | or | | 205 | or |
206 | .Dv IPC_RMID | | 206 | .Dv IPC_RMID |
207 | and the caller is not the super-user, nor does | | 207 | and the caller is not the super-user, nor does |
208 | the effective uid match either the | | 208 | the effective uid match either the |
209 | .Va sem_perm.uid | | 209 | .Va sem_perm.uid |
210 | or | | 210 | or |
211 | .Va sem_perm.cuid | | 211 | .Va sem_perm.cuid |
212 | fields of the data structure associated with the message queue. | | 212 | fields of the data structure associated with the semaphore. |
213 | .It Bq Er EACCES | | 213 | .It Bq Er EACCES |
214 | The caller has no operation permission for this semaphore. | | 214 | The caller has no operation permission for this semaphore. |
215 | .It Bq Er EINVAL | | 215 | .It Bq Er EINVAL |
216 | .Fa semid | | 216 | .Fa semid |
217 | is not a valid message semaphore identifier. | | 217 | is not a valid message semaphore identifier. |
218 | .Pp | | 218 | .Pp |
219 | .Va cmd | | 219 | .Va cmd |
220 | is not a valid command. | | 220 | is not a valid command. |
221 | .It Bq Er EFAULT | | 221 | .It Bq Er EFAULT |
222 | .Fa arg.buf | | 222 | .Fa arg.buf |
223 | or | | 223 | or |
224 | .Fa arg.array | | 224 | .Fa arg.array |
225 | specifies an invalid address. | | 225 | specifies an invalid address. |