Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys defparam all of the config variables associated with SYS...



details:   https://anonhg.NetBSD.org/src/rev/460ad4d921bd
branches:  trunk
changeset: 450298:460ad4d921bd
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Tue Apr 09 22:05:27 2019 +0000

description:
defparam all of the config variables associated with SYSV IPC stuff.
The variables were removed from sys/conf/param.c and moved into the
SYSV IPC code, but config options were never propagated via any opt_*
file.

This should fix an issue reported on netbsd-users list from Dima Veselov.

Note that this does not address other parameters included in that report,
including CHILD_MAX and NOFILE; this commit only affects items related to
the SYSV IPC code.  Also note that this does not affect non-built-in
sysv_ipc modules, for which you need to update the Makefile to use any
non-standard config values - just like any other non-built-in modules
which have config params.

XXX Pull-up to -8 and -8-0

XXX Note that there are a couple of panic() calls in msginit() which
XXX really should be changed to simple printf() and then result in
XXX msginit failure.  Unfortunately msginit() currently doesn't return
XXX a value so we cannot indicate failure to the caller.  I will fix
XXX this is a future commit.

diffstat:

 sys/conf/files      |   7 +++-
 sys/conf/param.c    |  67 +---------------------------------------------------
 sys/kern/sysv_ipc.c |   5 ++-
 3 files changed, 10 insertions(+), 69 deletions(-)

diffs (131 lines):

diff -r 8e6fd3996d2d -r 460ad4d921bd sys/conf/files
--- a/sys/conf/files    Tue Apr 09 19:10:21 2019 +0000
+++ b/sys/conf/files    Tue Apr 09 22:05:27 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files,v 1.1232 2019/03/25 19:24:30 maxv Exp $
+#      $NetBSD: files,v 1.1233 2019/04/09 22:05:27 pgoyette Exp $
 #      @(#)files.newconf       7.5 (Berkeley) 5/10/93
 
 version        20171118
@@ -73,7 +73,10 @@
 defflag opt_dtrace.h           KDTRACE_HOOKS
 
 defflag        opt_sysv.h              SYSVMSG SYSVSEM SYSVSHM
-defparam opt_sysvparam.h       SHMMAXPGS SEMMNI SEMMNS SEMUME SEMMNU
+defparam opt_sysvparam.h       MSGMAX MSGMNI MSGMNB MSGTQL MSGSSZ MSGSEG
+defparam opt_sysvparam.h       SEMMAP SEMMNI SEMMNS SEMMNU SEMMSL SEMOPM
+defparam opt_sysvparam.h       SEMUME SEMUSZ SEMVMX SEMAEM
+defparam opt_sysvparam.h       SHMMAX SHMMIN SHMMNI SHMSEG SHMMAXPGS
 
 defflag        opt_ntp.h               PPS_SYNC PPS_DEBUG NTP
 
diff -r 8e6fd3996d2d -r 460ad4d921bd sys/conf/param.c
--- a/sys/conf/param.c  Tue Apr 09 19:10:21 2019 +0000
+++ b/sys/conf/param.c  Tue Apr 09 22:05:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: param.c,v 1.67 2015/11/09 01:21:18 pgoyette Exp $      */
+/*     $NetBSD: param.c,v 1.68 2019/04/09 22:05:27 pgoyette Exp $      */
 
 /*
  * Copyright (c) 1980, 1986, 1989 Regents of the University of California.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: param.c,v 1.67 2015/11/09 01:21:18 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: param.c,v 1.68 2019/04/09 22:05:27 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_hz.h"
@@ -149,69 +149,6 @@
 #endif
 int    mcllowat = MCLLOWAT;
 
-#if XXX_PRG
-/*
- * Values in support of System V compatible shared memory.     XXX
- */
-#ifdef SYSVSHM
-#if !defined(SHMMAX) && defined(SHMMAXPGS)
-#define        SHMMAX  SHMMAXPGS       /* shminit() performs a `*= PAGE_SIZE' */
-#elif !defined(SHMMAX)
-#define SHMMAX 0
-#endif
-#ifndef        SHMMIN
-#define        SHMMIN  1
-#endif
-#ifndef        SHMMNI
-#define        SHMMNI  128             /* <64k, see IPCID_TO_IX in ipc.h */
-#endif
-#ifndef        SHMSEG
-#define        SHMSEG  128
-#endif
-
-struct shminfo shminfo = {
-       SHMMAX,
-       SHMMIN,
-       SHMMNI,
-       SHMSEG,
-       0
-};
-#endif
-
-/*
- * Values in support of System V compatible semaphores.
- */
-#ifdef SYSVSEM
-struct seminfo seminfo = {
-       SEMMAP,         /* # of entries in semaphore map */
-       SEMMNI,         /* # of semaphore identifiers */
-       SEMMNS,         /* # of semaphores in system */
-       SEMMNU,         /* # of undo structures in system */
-       SEMMSL,         /* max # of semaphores per id */
-       SEMOPM,         /* max # of operations per semop call */
-       SEMUME,         /* max # of undo entries per process */
-       SEMUSZ,         /* size in bytes of undo structure */
-       SEMVMX,         /* semaphore maximum value */
-       SEMAEM          /* adjust on exit max value */
-};
-#endif
-
-/*
- * Values in support of System V compatible messages.
- */
-#ifdef SYSVMSG
-struct msginfo msginfo = {
-       MSGMAX,         /* max chars in a message */
-       MSGMNI,         /* # of message queue identifiers */
-       MSGMNB,         /* max chars in a queue */
-       MSGTQL,         /* max messages in system */
-       MSGSSZ,         /* size of a message segment */
-                       /* (must be small power of 2 greater than 4) */
-       MSGSEG          /* number of message segments */
-};
-#endif
-#endif /* XXX_PRG */
-
 /*
  * Actual network mbuf sizes (read-only), for netstat.
  */
diff -r 8e6fd3996d2d -r 460ad4d921bd sys/kern/sysv_ipc.c
--- a/sys/kern/sysv_ipc.c       Tue Apr 09 19:10:21 2019 +0000
+++ b/sys/kern/sysv_ipc.c       Tue Apr 09 22:05:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysv_ipc.c,v 1.37 2019/03/01 11:06:57 pgoyette Exp $   */
+/*     $NetBSD: sysv_ipc.c,v 1.38 2019/04/09 22:05:27 pgoyette Exp $   */
 
 /*-
  * Copyright (c) 1998, 2007 The NetBSD Foundation, Inc.
@@ -30,10 +30,11 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysv_ipc.c,v 1.37 2019/03/01 11:06:57 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysv_ipc.c,v 1.38 2019/04/09 22:05:27 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sysv.h"
+#include "opt_sysvparam.h"
 #include "opt_compat_netbsd.h"
 #endif
 



Home | Main Index | Thread Index | Old Index