Initial (and probably final) release. Simple program to convert

errno numbers to strings.
This commit is contained in:
hjp 1997-12-05 08:39:46 +00:00
parent 780d07a12d
commit 3031a07735
2 changed files with 34 additions and 0 deletions

8
errno/GNUmakefile Normal file
View File

@ -0,0 +1,8 @@
include GNUmakerules
all: errno
errno:
clean:
rm errno
install: $(BINDIR)/errno

26
errno/errno.c Normal file
View File

@ -0,0 +1,26 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
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;
}