Remove *xattr syscalls.
[glibc.git] / sysdeps / unix / make_errlist.c
blob8b2b972a8a3eacca9e85cf374ec314d38fd660f2
1 /* Copyright (C) 1991,1992,1995,1997,1999,2001 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
19 #include <stdio.h>
20 #include <time.h>
22 /* Make a definition for sys_errlist. */
24 extern int sys_nerr;
25 #ifndef HAVE_STRERROR
26 extern const char *const sys_errlist[];
27 #endif
29 int
30 main (void)
32 register int i;
33 struct tm timenow;
34 time_t now;
35 int year;
37 now = time (NULL);
38 timenow = *localtime (&now);
40 year = timenow.tm_year + 1900;
42 printf ("/* Copyright (C) %d Free Software Foundation, Inc.\n\
43 This file is part of the GNU C Library.\n\
44 \n\
45 The GNU C Library is free software; you can redistribute it and/or\n\
46 modify it under the terms of the GNU Lesser General Public\n\
47 License as published by the Free Software Foundation; either\n\
48 version 2.1 of the License, or (at your option) any later version.\n\
49 \n\
50 The GNU C Library is distributed in the hope that it will be useful,\n\
51 but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
52 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n\
53 Lesser General Public License for more details.\n\
54 \n\
55 You should have received a copy of the GNU Lesser General Public\n\
56 License along with the GNU C Library; if not, write to the Free\n\
57 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n\
58 02111-1307 USA. */\n", year);
60 puts ("#include <stddef.h>\n");
61 puts ("#include <libintl.h>\n");
62 puts ("\n/* This is a list of all known `errno' codes. */\n");
64 printf ("\nconst int _sys_nerr = %d;\n\n", sys_nerr);
65 puts ("const char *const _sys_errlist[] =\n {");
67 for (i = 0; i < sys_nerr; ++i)
68 printf (" N_(\"%s\"),\n",
69 #ifdef HAVE_STRERROR
70 strerror (i)
71 #else /* ! HAVE_STRERROR */
72 sys_errlist[i]
73 #endif /* HAVE_STRERROR */
76 puts (" NULL\n };\n");
78 puts ("weak_alias (_sys_errlist, sys_errlist)");
79 puts ("weak_alias (_sys_nerr, sys_nerr)");
81 exit (0);