confstr() should return 0, not -1, on errors
confstr() should return 0, not (size_t)-1, on errors. The current
DragonFly BSD implementation returns -1 if sysctl() fails.
#2 Updated by guy over 10 years ago
Not with top-of-tree FreeBSD, it isn't - the top-of-tree FreeBSD code
The documentation, until recently, said it returned -1, but I filed a
bug about that:
and it was recently fixed:
As for NetBSD, I filed a bug on the code:
which is now closed - they changed the code and the man page.
Similar changes were made to OpenBSD in response to bug mail I sent:
so DragonFly is now inconsistent with the top of the tree of FreeBSD,
NetBSD, and OpenBSD, and its code is inconsistent with the 5.x and 6.x
releases of FreeBSD.
> I don't have
> a reference to POSIX.2 to verify the original specification.
Perhaps POSIX.2 said it returned -1 (I think my POSIX.2 is at work), but
what counts now is the Single UNIX Specification, and, as per the URL I
think I sent in my mail:
it says it returns 0 on errors.
#3 Updated by dillon over 10 years ago
:Not with top-of-tree FreeBSD, it isn't - the top-of-tree FreeBSD code
Seems pretty conclusive to me. Would someone like to make this
adjustment in our tree?