From owner-freebsd-bugs Mon Jun 24 17:10: 9 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4710B37B401 for ; Mon, 24 Jun 2002 17:10:03 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5P0A3l48077; Mon, 24 Jun 2002 17:10:03 -0700 (PDT) (envelope-from gnats) Date: Mon, 24 Jun 2002 17:10:03 -0700 (PDT) Message-Id: <200206250010.g5P0A3l48077@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Cyrille Lefevre Subject: Re: kern/39681: hidden kernel boot tunables added to sysctl as read-only mib Reply-To: Cyrille Lefevre Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/39681; it has been noted by GNATS. From: Cyrille Lefevre To: Bruce Evans Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: kern/39681: hidden kernel boot tunables added to sysctl as read-only mib Date: Tue, 25 Jun 2002 02:09:31 +0200 On Sun, Jun 23, 2002 at 04:42:09PM +1000, Bruce Evans wrote: > On Sun, 23 Jun 2002, Cyrille Lefevre wrote: [snip] > > +SYSCTL_QUAD(_kern, OID_AUTO, maxtsiz, CTLFLAG_RD, > > + &maxtsiz, 0, "Max text size"); > > +SYSCTL_QUAD(_kern, OID_AUTO, dfldsiz, CTLFLAG_RD, > > + &dfldsiz, 0, "Initial max data size"); > > +SYSCTL_QUAD(_kern, OID_AUTO, maxdsiz, CTLFLAG_RD, > > + &maxdsiz, 0, "Max data size"); > > +SYSCTL_QUAD(_kern, OID_AUTO, dflssiz, CTLFLAG_RD, > > + &dflssiz, 0, "Initial max stack size"); > > +SYSCTL_QUAD(_kern, OID_AUTO, maxssiz, CTLFLAG_RD, > > + &maxssiz, 0, "Max stack size"); > > +SYSCTL_QUAD(_kern, OID_AUTO, sgrowsiz, CTLFLAG_RD, > > + &sgrowsiz, 0, "Amount to grow stack"); [snip] > Support for intmax_t's might not even be needed yet, or might not apply. > Most of the `siz' variables here have a wrong type (u_quad_t). They > should have type vm_size_t or possibly size_t. But there is a problem > importing and exporting variables with a typedef'ed types via sysctl() > and/or TUNABLE*_FETCH(). Sysctl and the tunable mechanism only support > a limited number of types. Even u_quad_t's are not supported. Large > u_quad_t's are clipped to QUAD_MAX, without checking for overflow of > course. u_quad_t's for the `siz' variables only work because the sizes > are normally < QUAD_MAX even on 64-bit machines. so, what to do ? Cyrille. -- Cyrille Lefevre mailto:cyrille.lefevre@laposte.net 12, Rue de Bizerte 75017 Paris http://clefevre.fr.st tel/fax: +33 (0)1 45 22 83 85 gsm: +33 (0)6 80 94 76 63 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message