Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

While not as fancy as errno(1),

    perl -e '$! = shift and print "$!\n"' ERRNO
works to decode (nonzero) ERRNO if Perl is installed (per strerror(3) in the C runtime library linked to Perl, so YMMV on non-POSIXish platforms).

Speaking of portability, Microsoft's err.exe[1] is a conceptually similar tool that references a considerably larger collection of Windows error messages (user and kernel mode Win32 error codes, COM HRESULTs, etc) and is therefore far more useful on Windows platforms than anything naïvely implemented in terms of C runtime errno (e.g., my stupid Perl one-liner).



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: