sysctlbyname, issetugid implementation in libbsd

Guillem Jover guillem at
Sun Nov 22 13:44:59 PST 2015


On Fri, 2015-11-13 at 12:10:13 +0300, Alexey Perevalov wrote:
> I have a question regarding following 2 functions:
> sysctlbyname - specific for Mac OS X
> issetugid - specific for FreeBSD
> could libbsd support these functions or it's not libbsd responsibility?

Any function that is present on the libc or one of the closely related
libraries in BSD-based systems is a fine candidate for libbsd. The only
restriction is probably if the function is portable, or if it is not
if providing a stub would not break the semantics of the interface.

For the above two:

 * issetugid: This one seems to be available on most BSD based
   systems but it has slightly different semantics on FreeBSD than
   other BSD systems. Implementing the OpenBSD semantics should be
   easy by using at least the AT_SECURE entry from the auxv on
   GNU-based systems.

 * sysctlbyname: I don't think this function is easily portable as it
   is based on sysctlnametomib(3) for which I don't think there is a
   comparable interface on non-BSD systems, it also relies on sysctl(2)
   which at least on Linux it is obsolete and might have been
   completely disabled in the kernel build. But if someone can come
   up with a reasonable portable implementation, I'd be fine with its


More information about the libbsd mailing list