Source-Changes-HG archive

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

[src/trunk]: src Add a sysconf(3) knob for {ATEXIT_MAX}.



details:   https://anonhg.NetBSD.org/src/rev/f98683b5fdbe
branches:  trunk
changeset: 540607:f98683b5fdbe
user:      kleink <kleink%NetBSD.org@localhost>
date:      Thu Dec 19 23:31:54 2002 +0000

description:
Add a sysconf(3) knob for {ATEXIT_MAX}.

diffstat:

 lib/libc/gen/sysconf.3    |   7 +++++--
 lib/libc/gen/sysconf.c    |  12 ++++++++++--
 lib/libc/gen/sysctl.3     |   8 ++++++--
 lib/libc/gen/sysctl.c     |   7 +++++--
 sys/sys/sysctl.h          |   6 ++++--
 sys/sys/unistd.h          |   3 ++-
 usr.bin/getconf/getconf.c |   7 +++++--
 7 files changed, 37 insertions(+), 13 deletions(-)

diffs (197 lines):

diff -r af0332678c9a -r f98683b5fdbe lib/libc/gen/sysconf.3
--- a/lib/libc/gen/sysconf.3    Thu Dec 19 23:04:26 2002 +0000
+++ b/lib/libc/gen/sysconf.3    Thu Dec 19 23:31:54 2002 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: sysconf.3,v 1.20 2002/02/08 12:12:55 kleink Exp $
+.\"    $NetBSD: sysconf.3,v 1.21 2002/12/19 23:31:54 kleink Exp $
 .\"
 .\" Copyright (c) 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -33,7 +33,7 @@
 .\"
 .\"    @(#)sysconf.3   8.3 (Berkeley) 4/19/94
 .\"
-.Dd January 31, 2002
+.Dd December 19, 2002
 .Dt SYSCONF 3
 .Os
 .Sh NAME
@@ -68,6 +68,9 @@
 .It Li _SC_ARG_MAX
 The maximum bytes of argument to
 .Xr execve 2 .
+.It Li _SC_ATEXIT_MAX
+The maxmimum number of functions that may be registered with
+.Xr atexit 3 .
 .It Li _SC_CHILD_MAX
 The maximum number of simultaneous processes per user id.
 .It Li _SC_CLK_TCK
diff -r af0332678c9a -r f98683b5fdbe lib/libc/gen/sysconf.c
--- a/lib/libc/gen/sysconf.c    Thu Dec 19 23:04:26 2002 +0000
+++ b/lib/libc/gen/sysconf.c    Thu Dec 19 23:31:54 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysconf.c,v 1.16 2002/06/30 09:45:40 bjh21 Exp $       */
+/*     $NetBSD: sysconf.c,v 1.17 2002/12/19 23:31:54 kleink Exp $      */
 
 /*-
  * Copyright (c) 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)sysconf.c  8.2 (Berkeley) 3/20/94";
 #else
-__RCSID("$NetBSD: sysconf.c,v 1.16 2002/06/30 09:45:40 bjh21 Exp $");
+__RCSID("$NetBSD: sysconf.c,v 1.17 2002/12/19 23:31:54 kleink Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -258,6 +258,14 @@
        case _SC_XOPEN_SHM:
                mib[0] = CTL_KERN;
                mib[1] = KERN_SYSVSHM;
+               goto yesno;
+
+/* 1003.1-2001, XSI Option Group */
+       case _SC_ATEXIT_MAX:
+               mib[0] = CTL_USER;
+               mib[1] = USER_ATEXIT_MAX;
+               break;
+
 yesno:         if (sysctl(mib, 2, &value, &len, NULL, 0) == -1)
                        return (-1);
                if (value == 0)
diff -r af0332678c9a -r f98683b5fdbe lib/libc/gen/sysctl.3
--- a/lib/libc/gen/sysctl.3     Thu Dec 19 23:04:26 2002 +0000
+++ b/lib/libc/gen/sysctl.3     Thu Dec 19 23:31:54 2002 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: sysctl.3,v 1.105 2002/12/18 20:17:43 wiz Exp $
+.\"    $NetBSD: sysctl.3,v 1.106 2002/12/19 23:31:54 kleink Exp $
 .\"
 .\" Copyright (c) 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -33,7 +33,7 @@
 .\"
 .\"    @(#)sysctl.3    8.4 (Berkeley) 5/9/95
 .\"
-.Dd June 24, 1999
+.Dd December 19, 2002
 .Dt SYSCTL 3
 .Os
 .Sh NAME
@@ -1408,6 +1408,7 @@
 .It USER\_RE\_DUP\_MAX integer no
 .It USER\_STREAM\_MAX  integer no
 .It USER\_TZNAME\_MAX  integer no
+.It USER\_ATEXIT\_MAX  integer no
 .El
 .Bl -tag -width "123456"
 .Pp
@@ -1477,6 +1478,9 @@
 .It Li USER_TZNAME_MAX
 The minimum maximum number of types supported for the name of a
 timezone.
+.It Li USER_ATEXIT_MAX
+The maximum namber of functions that may be registered with
+.Xr atexit 3 .
 .El
 .Sh CTL_VM
 The string and integer information available for the CTL_VM level
diff -r af0332678c9a -r f98683b5fdbe lib/libc/gen/sysctl.c
--- a/lib/libc/gen/sysctl.c     Thu Dec 19 23:04:26 2002 +0000
+++ b/lib/libc/gen/sysctl.c     Thu Dec 19 23:31:54 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysctl.c,v 1.11 2000/01/22 22:19:12 mycroft Exp $      */
+/*     $NetBSD: sysctl.c,v 1.12 2002/12/19 23:31:55 kleink Exp $       */
 
 /*-
  * Copyright (c) 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)sysctl.c   8.2 (Berkeley) 1/4/94";
 #else
-__RCSID("$NetBSD: sysctl.c,v 1.11 2000/01/22 22:19:12 mycroft Exp $");
+__RCSID("$NetBSD: sysctl.c,v 1.12 2002/12/19 23:31:55 kleink Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -190,6 +190,9 @@
        case USER_TZNAME_MAX:
                *(int *)oldp = NAME_MAX;
                return (0);
+       case USER_ATEXIT_MAX:
+               *(int *)oldp = -1; /* ANSI C minimum provided; not limited */
+               return (0);
        default:
                errno = EINVAL;
                return (-1);
diff -r af0332678c9a -r f98683b5fdbe sys/sys/sysctl.h
--- a/sys/sys/sysctl.h  Thu Dec 19 23:04:26 2002 +0000
+++ b/sys/sys/sysctl.h  Thu Dec 19 23:31:54 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysctl.h,v 1.85 2002/12/11 19:14:35 jdolecek Exp $     */
+/*     $NetBSD: sysctl.h,v 1.86 2002/12/19 23:31:56 kleink Exp $       */
 
 /*
  * Copyright (c) 1989, 1993
@@ -527,7 +527,8 @@
 #define        USER_POSIX2_UPE         18      /* int: POSIX2_UPE */
 #define        USER_STREAM_MAX         19      /* int: POSIX2_STREAM_MAX */
 #define        USER_TZNAME_MAX         20      /* int: POSIX2_TZNAME_MAX */
-#define        USER_MAXID              21      /* number of valid user ids */
+#define        USER_ATEXIT_MAX         21      /* int: {ATEXIT_MAX} */
+#define        USER_MAXID              22      /* number of valid user ids */
 
 #define        CTL_USER_NAMES { \
        { 0, 0 }, \
@@ -551,6 +552,7 @@
        { "posix2_upe", CTLTYPE_INT }, \
        { "stream_max", CTLTYPE_INT }, \
        { "tzname_max", CTLTYPE_INT }, \
+       { "atexit_max", CTLTYPE_INT }, \
 }
 
 /*
diff -r af0332678c9a -r f98683b5fdbe sys/sys/unistd.h
--- a/sys/sys/unistd.h  Thu Dec 19 23:04:26 2002 +0000
+++ b/sys/sys/unistd.h  Thu Dec 19 23:31:54 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: unistd.h,v 1.20 2002/06/30 09:45:40 bjh21 Exp $        */
+/*     $NetBSD: unistd.h,v 1.21 2002/12/19 23:31:57 kleink Exp $       */
 
 /*
  * Copyright (c) 1989, 1993
@@ -159,6 +159,7 @@
 #define        _SC_LOGIN_NAME_MAX      37
 #define        _SC_MONOTONIC_CLOCK     38
 #define        _SC_CLK_TCK             39 /* New, variable version */
+#define        _SC_ATEXIT_MAX          40
 
 /* configurable system strings */
 #define        _CS_PATH                 1
diff -r af0332678c9a -r f98683b5fdbe usr.bin/getconf/getconf.c
--- a/usr.bin/getconf/getconf.c Thu Dec 19 23:04:26 2002 +0000
+++ b/usr.bin/getconf/getconf.c Thu Dec 19 23:31:54 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getconf.c,v 1.18 2002/08/05 06:35:44 tron Exp $        */
+/*     $NetBSD: getconf.c,v 1.19 2002/12/19 23:31:57 kleink Exp $      */
 
 /*-
  * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: getconf.c,v 1.18 2002/08/05 06:35:44 tron Exp $");
+__RCSID("$NetBSD: getconf.c,v 1.19 2002/12/19 23:31:57 kleink Exp $");
 #endif /* not lint */
 
 #include <err.h>
@@ -154,6 +154,9 @@
 
   /* X/Open CAE Spec. Issue 5 Version 2 Configurable System Variables */
   { "FILESIZEBITS",            PATHCONF,       _PC_FILESIZEBITS        },
+
+  /* POSIX.1-2001 XSI Option Group Configurable System Variables */
+  { "ATEXIT_MAX",              SYSCONF,        _SC_ATEXIT_MAX          },
   { NULL }
 };
 



Home | Main Index | Thread Index | Old Index