Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Sep 2001 12:33:38 -0500
From:      Chris Wicklein <chrisw@wicklein.org>
To:        Trent Nelson <nelsont@wa.switch.aust.com>, current@freebsd.org
Subject:   Re: problems with libkvm and sysctl
Message-ID:  <20010915123338.A2639@localhost.wicklein.org>
In-Reply-To: <20010912112528.H31684@freebsd06.udt>; from nelsont@wa.switch.aust.com on Wed, Sep 12, 2001 at 11:25:28AM %2B0800
References:  <20010909162258.92A6F37B409@hub.freebsd.org> <20010912112528.H31684@freebsd06.udt>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <chrisw@Wicklein.ORG>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010915123338.A2639>