diff --git a/errno/GNUmakefile b/errno/GNUmakefile new file mode 100644 index 0000000..2dfaf25 --- /dev/null +++ b/errno/GNUmakefile @@ -0,0 +1,8 @@ +include GNUmakerules + +all: errno + +errno: +clean: + rm errno +install: $(BINDIR)/errno diff --git a/errno/errno.c b/errno/errno.c new file mode 100644 index 0000000..ef09e34 --- /dev/null +++ b/errno/errno.c @@ -0,0 +1,26 @@ +#include +#include +#include + +char *cmnd; + +void usage(void) { + fprintf(stderr, "Usage: %s errno ...\n", cmnd); + exit(1); +} + + +int main(int argc, char **argv) { + int i; + + cmnd = argv[0]; + + if (argc <= 1) usage(); + + for (i = 1; i < argc; i++) { + int e = strtoul(argv[i], NULL, 0); + + printf("%d\t%s\n", e, strerror(e)); + } + return 0; +}