sysv_shm.c (12662) | sysv_shm.c (12819) |
---|---|
1/* $Id: sysv_shm.c,v 1.12 1995/12/04 02:26:53 jkh Exp $ */ | 1/* $Id: sysv_shm.c,v 1.13 1995/12/07 12:46:55 davidg Exp $ */ |
2/* $NetBSD: sysv_shm.c,v 1.23 1994/07/04 23:25:12 glass Exp $ */ 3 4/* 5 * Copyright (c) 1994 Adam Glass and Charles Hannum. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: --- 49 unchanged lines hidden (view full) --- 59extern int shmdt __P((struct proc *p, struct shmdt_args *uap, int *retval)); 60struct shmget_args; 61extern int shmget __P((struct proc *p, struct shmget_args *uap, int *retval)); 62 63static void shminit __P((void *)); 64SYSINIT(sysv_shm, SI_SUB_SYSV_SHM, SI_ORDER_FIRST, shminit, NULL) 65 66struct oshmctl_args; | 2/* $NetBSD: sysv_shm.c,v 1.23 1994/07/04 23:25:12 glass Exp $ */ 3 4/* 5 * Copyright (c) 1994 Adam Glass and Charles Hannum. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: --- 49 unchanged lines hidden (view full) --- 59extern int shmdt __P((struct proc *p, struct shmdt_args *uap, int *retval)); 60struct shmget_args; 61extern int shmget __P((struct proc *p, struct shmget_args *uap, int *retval)); 62 63static void shminit __P((void *)); 64SYSINIT(sysv_shm, SI_SUB_SYSV_SHM, SI_ORDER_FIRST, shminit, NULL) 65 66struct oshmctl_args; |
67int oshmctl __P((struct proc *p, struct oshmctl_args *uap, int *retval)); | 67static int oshmctl __P((struct proc *p, struct oshmctl_args *uap, int *retval)); |
68static int shmget_allocate_segment __P((struct proc *p, struct shmget_args *uap, int mode, int *retval)); 69static int shmget_existing __P((struct proc *p, struct shmget_args *uap, int mode, int segnum, int *retval)); 70 71/* XXX casting to (sy_call_t *) is bogus, as usual. */ 72sy_call_t *shmcalls[] = { 73 (sy_call_t *)shmat, (sy_call_t *)oshmctl, 74 (sy_call_t *)shmdt, (sy_call_t *)shmget, 75 (sy_call_t *)shmctl 76}; 77 78#define SHMSEG_FREE 0x0200 79#define SHMSEG_REMOVED 0x0400 80#define SHMSEG_ALLOCATED 0x0800 81#define SHMSEG_WANTED 0x1000 82 | 68static int shmget_allocate_segment __P((struct proc *p, struct shmget_args *uap, int mode, int *retval)); 69static int shmget_existing __P((struct proc *p, struct shmget_args *uap, int mode, int segnum, int *retval)); 70 71/* XXX casting to (sy_call_t *) is bogus, as usual. */ 72sy_call_t *shmcalls[] = { 73 (sy_call_t *)shmat, (sy_call_t *)oshmctl, 74 (sy_call_t *)shmdt, (sy_call_t *)shmget, 75 (sy_call_t *)shmctl 76}; 77 78#define SHMSEG_FREE 0x0200 79#define SHMSEG_REMOVED 0x0400 80#define SHMSEG_ALLOCATED 0x0800 81#define SHMSEG_WANTED 0x1000 82 |
83vm_map_t sysvshm_map; 84int shm_last_free, shm_nused, shm_committed; | 83static vm_map_t sysvshm_map; 84static int shm_last_free, shm_nused, shm_committed; |
85struct shmid_ds *shmsegs; 86 87struct shm_handle { 88 vm_offset_t kva; 89}; 90 91struct shmmap_state { 92 vm_offset_t va; --- 186 unchanged lines hidden (view full) --- 279}; 280 281struct oshmctl_args { 282 int shmid; 283 int cmd; 284 struct oshmid_ds *ubuf; 285}; 286 | 85struct shmid_ds *shmsegs; 86 87struct shm_handle { 88 vm_offset_t kva; 89}; 90 91struct shmmap_state { 92 vm_offset_t va; --- 186 unchanged lines hidden (view full) --- 279}; 280 281struct oshmctl_args { 282 int shmid; 283 int cmd; 284 struct oshmid_ds *ubuf; 285}; 286 |
287int | 287static int |
288oshmctl(p, uap, retval) 289 struct proc *p; 290 struct oshmctl_args *uap; 291 int *retval; 292{ 293#ifdef COMPAT_43 294 int error; 295 struct ucred *cred = p->p_ucred; --- 306 unchanged lines hidden --- | 288oshmctl(p, uap, retval) 289 struct proc *p; 290 struct oshmctl_args *uap; 291 int *retval; 292{ 293#ifdef COMPAT_43 294 int error; 295 struct ucred *cred = p->p_ucred; --- 306 unchanged lines hidden --- |