Deleted Added
full compact
sysv_shm.c (118607) sysv_shm.c (118615)
1/* $NetBSD: sysv_shm.c,v 1.23 1994/07/04 23:25:12 glass Exp $ */
2/*
3 * Copyright (c) 1994 Adam Glass and Charles Hannum. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#include <sys/cdefs.h>
1/* $NetBSD: sysv_shm.c,v 1.23 1994/07/04 23:25:12 glass Exp $ */
2/*
3 * Copyright (c) 1994 Adam Glass and Charles Hannum. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/kern/sysv_shm.c 118607 2003-08-07 15:04:27Z jhb $");
33__FBSDID("$FreeBSD: head/sys/kern/sysv_shm.c 118615 2003-08-07 16:42:27Z nectar $");
34
35#include "opt_compat.h"
36#include "opt_sysvipc.h"
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/kernel.h>
41#include <sys/lock.h>

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

779/*
780 * MPSAFE
781 */
782int
783shmsys(td, uap)
784 struct thread *td;
785 /* XXX actually varargs. */
786 struct shmsys_args /* {
34
35#include "opt_compat.h"
36#include "opt_sysvipc.h"
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/kernel.h>
41#include <sys/lock.h>

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

779/*
780 * MPSAFE
781 */
782int
783shmsys(td, uap)
784 struct thread *td;
785 /* XXX actually varargs. */
786 struct shmsys_args /* {
787 u_int which;
787 int which;
788 int a2;
789 int a3;
790 int a4;
791 } */ *uap;
792{
793 int error;
794
795 if (!jail_sysvipc_allowed && jailed(td->td_ucred))
796 return (ENOSYS);
788 int a2;
789 int a3;
790 int a4;
791 } */ *uap;
792{
793 int error;
794
795 if (!jail_sysvipc_allowed && jailed(td->td_ucred))
796 return (ENOSYS);
797 if (uap->which >= sizeof(shmcalls)/sizeof(shmcalls[0]))
797 if (uap->which < 0 ||
798 uap->which >= sizeof(shmcalls)/sizeof(shmcalls[0]))
798 return (EINVAL);
799 mtx_lock(&Giant);
800 error = (*shmcalls[uap->which])(td, &uap->a2);
801 mtx_unlock(&Giant);
802 return (error);
803}
804
805static void

--- 144 unchanged lines hidden ---
799 return (EINVAL);
800 mtx_lock(&Giant);
801 error = (*shmcalls[uap->which])(td, &uap->a2);
802 mtx_unlock(&Giant);
803 return (error);
804}
805
806static void

--- 144 unchanged lines hidden ---