Re: Single-user mode selector
Re: Single-user mode selector
- Subject: Re: Single-user mode selector
- From: Terry Lambert <email@hidden>
- Date: Mon, 14 Apr 2008 08:19:50 -0700
Use the string version of the selector and sysctlbyname(). Expect
that MIB-based sysctl() and OID definitions will go away at some point
in the future, as they are not automatically extensible without
recompilation of the command line tool. The other advantage of by
name sysctl() is that you can know if it is supported or not on a
given OS version by whether it returns an error, which is helpful to
future-proof your applications. That way if you get run on an older
version of the OS, you can decide to still run.
All that said, the selector itself is not particularly useful, since
launchd gets a -s argument in single user mode now, and it's really
the only application that should care.
-- Terry
On Apr 13, 2008, at 7:07 PM, Tony Scaminaci
<email@hidden> wrote:
I just built my application under Xcode 3.0 and noticed that there's
a new parameter returned by sysctl called kern.singleuser. However,
I can't find a sysctl selector for this in sysctl.h. I was using
KERN_SECURELVL in previous OS versions to determine whether I was
running in single-user mode but this selector now returns 0 in
multiuser mode under Leopard. What is the selector for
kern.singleuser?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden