From 3031a0773516fd26e66d06cfa24c76426f146a09 Mon Sep 17 00:00:00 2001 From: hjp Date: Fri, 5 Dec 1997 08:39:46 +0000 Subject: [PATCH] Initial (and probably final) release. Simple program to convert errno numbers to strings. --- errno/GNUmakefile | 8 ++++++++ errno/errno.c | 26 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 errno/GNUmakefile create mode 100644 errno/errno.c 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; +}