Skip to content

Instantly share code, notes, and snippets.

@rayddteam
Created September 20, 2017 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rayddteam/12a0dc2b0ab6f2f05d98e1cef7f92964 to your computer and use it in GitHub Desktop.
Save rayddteam/12a0dc2b0ab6f2f05d98e1cef7f92964 to your computer and use it in GitHub Desktop.
Linux has bad errno documentation, so instead of dig for code meaning just do strerror.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int
main(int argc, char **argv)
{
if (argc > 1)
printf("err %s\n", strerror(atoi(argv[1])));
else
printf("Usage: %s errno\n", argv[0]);
return (0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment