From owner-freebsd-arch Mon Jun 4 23: 0:29 2001 Delivered-To: freebsd-arch@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id 0182237B405 for ; Mon, 4 Jun 2001 23:00:27 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.3/8.11.3) with ESMTP id f555x1165711; Tue, 5 Jun 2001 07:59:01 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Jim Pirzyk Cc: freebsd-arch@FreeBSD.ORG Subject: Re: sysctl interger type max In-Reply-To: Your message of "Mon, 04 Jun 2001 12:49:14 PDT." <01060412491406.00744@snoopy> Date: Tue, 05 Jun 2001 07:59:01 +0200 Message-ID: <65709.991720741@critter> From: Poul-Henning Kamp Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <01060412491406.00744@snoopy>, Jim Pirzyk writes: >On Monday 04 June 2001 12:43 pm, Poul-Henning Kamp wrote: >> In message <01060412361804.00744@snoopy>, Jim Pirzyk writes: >> >On Monday 04 June 2001 12:26 pm, Poul-Henning Kamp wrote: >> >> In message <01060412242703.00744@snoopy>, Jim Pirzyk writes: >> >> >In sysctl(8), you can set an integer type, but the max value >> >> >an int can be is 2 * N-1 where N is the size of int. This leads >> >> >to a problem when trying to set kern.hostid and the number is >> >> >greater that 2GB on an IA32 system. So my question is should >> >> >CTLTYPE_INT be treated as a long or some other larger numeric >> >> >number? Or should we declare some CLTYPE_UINT type? >> >> >> >> We do have an SYSCTL_UINT these days. >> > >> >Yes for establishing the oid in the kernel, but sysctl command >> >line is limited to 2 * 31 bits even if the variable is set to >> >CLTYPE_{UINT|LONG|ULONG}. This means you cannot set the variables >> >to a possible range of values. >> >> Then sysctl(8) is obviously broken... > >Yes, so how should it be fixed? Add another CTLTYPE_* or make >CTLTYPE_INT handle say up to 'long long'? CTLTYPE_UINT should be fixed in sysctl(8) to handle [0..2^32-1] -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message