Deleted Added
full compact
sysv_sem.c (116182) sysv_sem.c (118615)
1/*
2 * Implementation of SVID semaphores
3 *
4 * Author: Daniel Boulet
5 *
6 * This software is provided ``AS IS'' without any warranties of any kind.
7 */
8
9#include <sys/cdefs.h>
1/*
2 * Implementation of SVID semaphores
3 *
4 * Author: Daniel Boulet
5 *
6 * This software is provided ``AS IS'' without any warranties of any kind.
7 */
8
9#include <sys/cdefs.h>
10__FBSDID("$FreeBSD: head/sys/kern/sysv_sem.c 116182 2003-06-11 00:56:59Z obrien $");
10__FBSDID("$FreeBSD: head/sys/kern/sysv_sem.c 118615 2003-08-07 16:42:27Z nectar $");
11
12#include "opt_sysvipc.h"
13
14#include <sys/param.h>
15#include <sys/systm.h>
16#include <sys/sysproto.h>
17#include <sys/eventhandler.h>
18#include <sys/kernel.h>

--- 251 unchanged lines hidden (view full) ---

270 *
271 * MPSAFE
272 */
273int
274semsys(td, uap)
275 struct thread *td;
276 /* XXX actually varargs. */
277 struct semsys_args /* {
11
12#include "opt_sysvipc.h"
13
14#include <sys/param.h>
15#include <sys/systm.h>
16#include <sys/sysproto.h>
17#include <sys/eventhandler.h>
18#include <sys/kernel.h>

--- 251 unchanged lines hidden (view full) ---

270 *
271 * MPSAFE
272 */
273int
274semsys(td, uap)
275 struct thread *td;
276 /* XXX actually varargs. */
277 struct semsys_args /* {
278 u_int which;
278 int which;
279 int a2;
280 int a3;
281 int a4;
282 int a5;
283 } */ *uap;
284{
285 int error;
286
287 if (!jail_sysvipc_allowed && jailed(td->td_ucred))
288 return (ENOSYS);
279 int a2;
280 int a3;
281 int a4;
282 int a5;
283 } */ *uap;
284{
285 int error;
286
287 if (!jail_sysvipc_allowed && jailed(td->td_ucred))
288 return (ENOSYS);
289 if (uap->which >= sizeof(semcalls)/sizeof(semcalls[0]))
289 if (uap->which < 0 ||
290 uap->which >= sizeof(semcalls)/sizeof(semcalls[0]))
290 return (EINVAL);
291 error = (*semcalls[uap->which])(td, &uap->a2);
292 return (error);
293}
294
295/*
296 * Allocate a new sem_undo structure for a process
297 * (returns ptr to structure or NULL if no more room)

--- 932 unchanged lines hidden ---
291 return (EINVAL);
292 error = (*semcalls[uap->which])(td, &uap->a2);
293 return (error);
294}
295
296/*
297 * Allocate a new sem_undo structure for a process
298 * (returns ptr to structure or NULL if no more room)

--- 932 unchanged lines hidden ---