Patch-ID: bash32-044
[bash.git] / CWRU / misc / errlist.c
blob3970ba19310970ea4700f3f8994742392bb21415
1 /*
2 * If necessary, link with lib/sh/libsh.a
3 */
5 /* Copyright (C) 1998-2002 Free Software Foundation, Inc.
7 This file is part of GNU Bash, the Bourne Again SHell.
9 Bash is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 2, or (at your option) any later
12 version.
14 Bash is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 for more details.
19 You should have received a copy of the GNU General Public License along
20 with Bash; see the file COPYING. If not, write to the Free Software
21 Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
23 #include <stdio.h>
24 #include <errno.h>
26 extern char *strerror();
28 extern int sys_nerr;
30 int
31 main(c, v)
32 int c;
33 char **v;
35 int i, n;
37 if (c == 1) {
38 for (i = 1; i < sys_nerr; i++)
39 printf("%d --> %s\n", i, strerror(i));
40 } else {
41 for (i = 1; i < c; i++) {
42 n = atoi(v[i]);
43 printf("%d --> %s\n", n, strerror(n));
46 exit (0);
49 programming_error(a, b)
50 char *a;
51 int b;
55 fatal_error()