From owner-freebsd-current Sat Sep 15 10:33:13 2001 Delivered-To: freebsd-current@freebsd.org Received: from localhost.wicklein.org (c46422-a.mntp1.il.home.com [65.6.31.160]) by hub.freebsd.org (Postfix) with ESMTP id 89FD237B405 for ; Sat, 15 Sep 2001 10:33:11 -0700 (PDT) Received: (from chrisw@localhost) by localhost.wicklein.org (8.10.2/8.10.2) id f8FHXdM02647; Sat, 15 Sep 2001 12:33:39 -0500 (CDT) Date: Sat, 15 Sep 2001 12:33:38 -0500 From: Chris Wicklein To: Trent Nelson , current@freebsd.org Subject: Re: problems with libkvm and sysctl Message-ID: <20010915123338.A2639@localhost.wicklein.org> References: <20010909162258.92A6F37B409@hub.freebsd.org> <20010912112528.H31684@freebsd06.udt> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010912112528.H31684@freebsd06.udt>; from nelsont@wa.switch.aust.com on Wed, Sep 12, 2001 at 11:25:28AM +0800 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Sep 12, 2001 at 11:25:28AM +0800, Trent Nelson wrote: > On Sun, Sep 09, 2001 at 11:23:34AM -0500, chrisw@Wicklein.ORG wrote: > > What do you get when you run the attached program as root? > kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf); > kd2 = kvm_open(NULL, NULL, NULL, O_RDONLY, > "kvm_open failed"); Both of these calls completed successfully when executed as root, as does my own code. This code also has the same behavior on -CURRENT as 4.1.1-STABLE. I'm not sure what I was observing last week. Interestingly, I discovered that by replacing NULL as an argument to kvm_open with "/dev/null" (a prompt I took from top in -CURRENT) this code works for users other than root. I don't understand what the difference in semantics between using /dev/null as a exec/core/swap file and using a NULL pointer is, but the former seems to work. Thanks, -- Chris Wicklein To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message