summaryrefslogtreecommitdiff
path: root/sysdeps/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/gnu')
-rw-r--r--sysdeps/gnu/errlist.awk15
-rw-r--r--sysdeps/gnu/errlist.c13
2 files changed, 23 insertions, 5 deletions
diff --git a/sysdeps/gnu/errlist.awk b/sysdeps/gnu/errlist.awk
index cf7058e293..6e9ad45966 100644
--- a/sysdeps/gnu/errlist.awk
+++ b/sysdeps/gnu/errlist.awk
@@ -1,4 +1,4 @@
-# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
+# Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -32,7 +32,14 @@ BEGIN {
print "";
print "#include <errno.h>";
print "";
- print "const char *const _sys_errlist[] =";
+ print "#ifndef SYS_ERRLIST";
+ print "# define SYS_ERRLIST _sys_errlist";
+ print "#endif";
+ print "#ifndef SYS_NERR";
+ print "# define SYS_NERR _sys_nerr";
+ print "#endif";
+ print "";
+ print "const char *const SYS_ERRLIST[] =";
print " {";
print " [0] = N_(\"Success\"),"
}
@@ -77,7 +84,9 @@ errnoh == 4 \
END {
print " };";
print "";
- print "const int _sys_nerr = sizeof _sys_errlist / sizeof _sys_errlist[0];";
+ print "const int SYS_NERR = sizeof SYS_ERRLIST / sizeof SYS_ERRLIST [0];";
+ print "#ifndef PIC";
print "weak_alias (_sys_errlist, sys_errlist)";
print "weak_alias (_sys_nerr, sys_nerr)";
+ print "#endif";
}
diff --git a/sysdeps/gnu/errlist.c b/sysdeps/gnu/errlist.c
index 7c0e78abf0..0d12cb32c9 100644
--- a/sysdeps/gnu/errlist.c
+++ b/sysdeps/gnu/errlist.c
@@ -2,7 +2,14 @@
#include <errno.h>
-const char *const _sys_errlist[] =
+#ifndef SYS_ERRLIST
+# define SYS_ERRLIST _sys_errlist
+#endif
+#ifndef SYS_NERR
+# define SYS_NERR _sys_nerr
+#endif
+
+const char *const SYS_ERRLIST[] =
{
[0] = N_("Success"),
#ifdef EPERM
@@ -807,6 +814,8 @@ TRANS This error code has no purpose. */
#endif
};
-const int _sys_nerr = sizeof _sys_errlist / sizeof _sys_errlist[0];
+const int SYS_NERR = sizeof SYS_ERRLIST / sizeof SYS_ERRLIST [0];
+#ifndef PIC
weak_alias (_sys_errlist, sys_errlist)
weak_alias (_sys_nerr, sys_nerr)
+#endif