summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1998-12-14 08:34:55 +0000
committerdillon <dillon@FreeBSD.org>1998-12-14 08:34:55 +0000
commit5b976b6d8d996bf25028267a42ebd0f20149113c (patch)
tree2d19c63a459b64a38c8e388b378c3d622afa3e46
parent5b20a73d8ea8ff4451e989a348a672c6abc0c00e (diff)
downloadFreeBSD-src-5b976b6d8d996bf25028267a42ebd0f20149113c.zip
FreeBSD-src-5b976b6d8d996bf25028267a42ebd0f20149113c.tar.gz
Fixed problems with kernel config file overrides of sysv semaphore
parameters. Prior to this fix a kernel config override would effect only some of the kernel files, resulting in panics. PR: kern/9068
-rw-r--r--sys/conf/param.c4
-rw-r--r--sys/kern/subr_param.c4
-rw-r--r--sys/kern/sysv_sem.c4
-rw-r--r--sys/sys/sem.h6
4 files changed, 11 insertions, 7 deletions
diff --git a/sys/conf/param.c b/sys/conf/param.c
index 6736b96..ef98c59 100644
--- a/sys/conf/param.c
+++ b/sys/conf/param.c
@@ -36,9 +36,11 @@
* SUCH DAMAGE.
*
* @(#)param.c 8.3 (Berkeley) 8/20/94
- * $Id: param.c,v 1.30 1998/07/11 13:06:38 bde Exp $
+ * $Id: param.c,v 1.31 1998/11/05 14:28:17 dg Exp $
*/
+#include <stddef.h>
+
#include "opt_sysvipc.h"
#include "opt_param.h"
diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c
index 6736b96..ef98c59 100644
--- a/sys/kern/subr_param.c
+++ b/sys/kern/subr_param.c
@@ -36,9 +36,11 @@
* SUCH DAMAGE.
*
* @(#)param.c 8.3 (Berkeley) 8/20/94
- * $Id: param.c,v 1.30 1998/07/11 13:06:38 bde Exp $
+ * $Id: param.c,v 1.31 1998/11/05 14:28:17 dg Exp $
*/
+#include <stddef.h>
+
#include "opt_sysvipc.h"
#include "opt_param.h"
diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c
index d35bbca..fb04c42 100644
--- a/sys/kern/sysv_sem.c
+++ b/sys/kern/sysv_sem.c
@@ -1,4 +1,4 @@
-/* $Id: sysv_sem.c,v 1.20 1997/11/06 19:29:24 phk Exp $ */
+/* $Id: sysv_sem.c,v 1.21 1998/03/30 09:50:41 phk Exp $ */
/*
* Implementation of SVID semaphores
@@ -276,7 +276,7 @@ semundo_adjust(p, supptr, semid, semnum, adjval)
/* Didn't find the right entry - create it */
if (adjval == 0)
return(0);
- if (suptr->un_cnt != SEMUME) {
+ if (suptr->un_cnt != seminfo.semume) {
sunptr = &suptr->un_ent[suptr->un_cnt];
suptr->un_cnt++;
sunptr->un_adjval = adjval;
diff --git a/sys/sys/sem.h b/sys/sys/sem.h
index a57e9b8..7768180 100644
--- a/sys/sys/sem.h
+++ b/sys/sys/sem.h
@@ -1,4 +1,4 @@
-/* $Id: sem.h,v 1.14 1998/05/31 04:09:09 steve Exp $ */
+/* $Id: sem.h,v 1.15 1998/07/15 02:32:32 bde Exp $ */
/* $NetBSD: sem.h,v 1.5 1994/06/29 06:45:15 cgd Exp $ */
/*
@@ -141,7 +141,7 @@ extern struct seminfo seminfo;
#endif
/* actual size of an undo structure */
-#define SEMUSZ (sizeof(struct sem_undo)+sizeof(struct undo)*SEMUME)
+#define SEMUSZ (offsetof(struct sem_undo, un_ent[SEMUME]))
extern struct semid_ds *sema; /* semaphore id pool */
extern struct sem *sem; /* semaphore pool */
@@ -150,7 +150,7 @@ extern int *semu; /* undo structure pool */
/*
* Macro to find a particular sem_undo vector
*/
-#define SEMU(ix) ((struct sem_undo *)(((intptr_t)semu)+ix * SEMUSZ))
+#define SEMU(ix) ((struct sem_undo *)(((intptr_t)semu)+ix * seminfo.semusz))
/*
* Process sem_undo vectors at proc exit.
OpenPOWER on IntegriCloud