According to http://www.opengroup.org/onlinepubs/009695399/functions/confstr.html confstr() should return 0, not (size_t)-1, on errors. The current DragonFly BSD implementation returns -1 if sysctl() fails.