Zeroing errno is superfluous but otherwise LGTM. You're right that uname() can return anything non-zero but I think Solaris/SmartOS is the only UNIX that actually does that. :-)