From owner-freebsd-hackers Sun Jun 11 21: 2:17 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mass.cdrom.com (adsl-63-206-88-224.dsl.snfc21.pacbell.net [63.206.88.224]) by hub.freebsd.org (Postfix) with ESMTP id 9919037B948 for ; Sun, 11 Jun 2000 21:02:12 -0700 (PDT) (envelope-from msmith@mass.cdrom.com) Received: from mass.cdrom.com (localhost [127.0.0.1]) by mass.cdrom.com (8.9.3/8.9.3) with ESMTP id VAA16187; Sun, 11 Jun 2000 21:06:04 -0700 (PDT) (envelope-from msmith@mass.cdrom.com) Message-Id: <200006120406.VAA16187@mass.cdrom.com> X-Mailer: exmh version 2.1.1 10/15/1999 To: Alfred Perlstein Cc: hackers@freebsd.org Subject: Re: getting the kernel environment? In-reply-to: Your message of "Sun, 11 Jun 2000 20:28:25 PDT." <20000611202824.U18462@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 11 Jun 2000 21:06:04 -0700 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > How does one get the environment passed from the loader to the > kernel from userland? > > Yes, I see the sysctl_kernenv in kern_environment.c, but I'm having > trouble decyphering as how to use it. Use the sysctl lookup function to get the OID for kern.environment, then tack an integer on the end and start incrementing it until you get ENOENT. Basically the same way you get the list of network interfaces. -- \\ Give a man a fish, and you feed him for a day. \\ Mike Smith \\ Tell him he should learn how to fish himself, \\ msmith@freebsd.org \\ and he'll hate you for a lifetime. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message