From owner-freebsd-arch Fri Feb 23 16:17:43 2001 Delivered-To: freebsd-arch@freebsd.org Received: from molly.straylight.com (molly.straylight.com [209.68.199.242]) by hub.freebsd.org (Postfix) with ESMTP id A049537B4EC for ; Fri, 23 Feb 2001 16:17:39 -0800 (PST) (envelope-from jonathan@graehl.org) Received: from dickie (case.straylight.com [209.68.199.244]) by molly.straylight.com (8.11.0/8.10.0) with SMTP id f1O0Ck608121 for ; Fri, 23 Feb 2001 16:12:46 -0800 From: "Jonathan Graehl" To: "freebsd-Arch" Subject: RE: sysctl kern.fallback_elf_brand Date: Fri, 23 Feb 2001 16:19:16 -0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > Yes, I thought about doing that as well, but thought it might be > > clearer to have the '-1' documented somewhere, especially since > > it is visible to the user via a sysctl. > > Then write a SYSCTL_PROC that uses strings to interface to the user > rather than > numbers... Speaking of sysctl without a defined numeric code ... #include #include #include #include #include #include #include #include #include I had to include all that kernel junk (grep, parse error messages, repeat - if there are dependencies, why can't *_var.h include them for me?) just to get a few codes for some net.inet.* sysctls. I was going to come up with a patch to properly #ifdef _KERNEL the offending nonsense, but then I discovered by searching kernel source that a few of the sysctls I wanted could only be referenced by strings ... man sysctl(3) does not mention any of this. sysctl should be prominently marked as deprecated in favor of sysctlbyname, since many of the sysctl-code-containing include files don't aren't vetted properly for inclusion by user code. I wanted to use the numeric codes to benefit from compile-time checking. I was not concerned with "optimization" of a one-off call. Overall, I was isappointed with my wild-goose-chase encouraged by the misleading documentation for sysctl. -Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message