From 25ea8c8a69576ca14e0d418bcc7d03b82db24db2 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 17 Dec 2002 23:11:33 +0000 Subject: Make SysV-style shared memory and semaphore limits sysctl'able. Instead of allocating a static amount of memory for the data structures via valloc() in allocsys(), allocate things dynamically using pool(9) when possible and malloc(9) when not. The various members of struct seminfo and struct shminfo are in kern.seminfo and kern.shminfo respectively (not all members of kern.seminfo are changable). The data structures used still leave something to be desired but things are not made worse in that respect by this commit. --- sys/arch/vax/vax/machdep.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'sys/arch/vax') diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c index 22cb80785a9..0d52dd531c3 100644 --- a/sys/arch/vax/vax/machdep.c +++ b/sys/arch/vax/vax/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.62 2002/11/08 01:33:28 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.63 2002/12/17 23:11:32 millert Exp $ */ /* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */ /* @@ -81,12 +81,6 @@ #ifdef SYSVMSG #include #endif -#ifdef SYSVSEM -#include -#endif -#ifdef SYSVSHM -#include -#endif #include #include @@ -798,19 +792,6 @@ allocsys(v) register caddr_t v; { -#ifdef SYSVSHM - shminfo.shmmax = shmmaxpgs; - shminfo.shmall = shmmaxpgs; - shminfo.shmseg = shmseg; - VALLOC(shmsegs, struct shmid_ds, shminfo.shmmni); -#endif -#ifdef SYSVSEM - VALLOC(sema, struct semid_ds, seminfo.semmni); - VALLOC(sem, struct sem, seminfo.semmns); - - /* This is pretty disgusting! */ - VALLOC(semu, int, (seminfo.semmnu * seminfo.semusz) / sizeof(int)); -#endif #ifdef SYSVMSG VALLOC(msgpool, char, msginfo.msgmax); VALLOC(msgmaps, struct msgmap, msginfo.msgseg); -- cgit v1.2.3