summaryrefslogtreecommitdiff
path: root/libc/string
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-01-18 12:16:01 +0000
committerMike Frysinger <vapier@gentoo.org>2006-01-18 12:16:01 +0000
commit8deadda0884724ab5f7f2cdf6c6f00d1be4ee7db (patch)
tree7b914317f37c411be29d1e42f96cc4b21ea3d616 /libc/string
parent6d8560297be954e2ff73c9545300ae1b477b7433 (diff)
check for signal existence rather than using arch defines
Diffstat (limited to 'libc/string')
-rw-r--r--libc/string/__xpg_strerror_r.c13
-rw-r--r--libc/string/_string_syssigmsgs.c2
-rw-r--r--libc/string/strsignal.c8
-rw-r--r--libc/string/sys_siglist.c4
4 files changed, 13 insertions, 14 deletions
diff --git a/libc/string/__xpg_strerror_r.c b/libc/string/__xpg_strerror_r.c
index 6059cbcbd..6536995e6 100644
--- a/libc/string/__xpg_strerror_r.c
+++ b/libc/string/__xpg_strerror_r.c
@@ -145,14 +145,14 @@ static const unsigned char estridx[] = {
ENAVAIL,
EISNAM,
EREMOTEIO,
-#ifdef __mips__
- 0, /* mips has an outrageous value for this... */
+#if EDQUOT > 200 /* mips has an outrageous value for this... */
+ 0,
#else
EDQUOT,
#endif
ENOMEDIUM,
EMEDIUMTYPE,
-#if defined(__mips__) || defined(__sparc__)
+#if EDEADLOCK != EDEADLK
EDEADLOCK,
#endif
};
@@ -181,11 +181,10 @@ int __xpg_strerror_r(int errnum, char *strerrbuf, size_t buflen)
}
}
i = INT_MAX; /* Failed, but may need to check mips special case. */
-#ifdef __mips__
- if (errnum == EDQUOT) { /* Deal with large EDQUOT value on mips */
+#if EDQUOT > 200 /* Deal with large EDQUOT value on mips */
+ if (errnum == EDQUOT)
i = 122;
- }
-#endif /* __mips__ */
+#endif
GOT_ESTRIDX:
#else
/* No errno to string index translation needed. */
diff --git a/libc/string/_string_syssigmsgs.c b/libc/string/_string_syssigmsgs.c
index a89f582b4..26c0948f4 100644
--- a/libc/string/_string_syssigmsgs.c
+++ b/libc/string/_string_syssigmsgs.c
@@ -43,7 +43,7 @@ const char _string_syssigmsgs[] = {
/* 29: 445, 13 */ "I/O possible\0"
/* 30: 458, 14 */ "Power failure\0"
/* 31: 472, 16 */ "Bad system call"
-#if defined(__alpha__) || defined(__mips__) || defined(__hppa__) || defined(__sparc__)
+#if defined SIGEMT
/* 32: 488, 9 */ "\0EMT trap"
#endif
};
diff --git a/libc/string/strsignal.c b/libc/string/strsignal.c
index b99facc81..bb5ada716 100644
--- a/libc/string/strsignal.c
+++ b/libc/string/strsignal.c
@@ -58,10 +58,10 @@ static const unsigned char sstridx[] = {
SIGPIPE,
SIGALRM,
SIGTERM,
-#if defined(__alpha__) || defined(__mips__) || defined(__sparc__)
- 0,
-#else
+#if defined SIGSTKFLT
SIGSTKFLT,
+#else
+ 0,
#endif
SIGCHLD,
SIGCONT,
@@ -78,7 +78,7 @@ static const unsigned char sstridx[] = {
SIGIO,
SIGPWR,
SIGSYS,
-#if defined(__alpha__) || defined(__mips__) || defined(__hppa__) || defined(__sparc__)
+#if defined SIGEMT
SIGEMT,
#endif
};
diff --git a/libc/string/sys_siglist.c b/libc/string/sys_siglist.c
index 0f69856ba..844337536 100644
--- a/libc/string/sys_siglist.c
+++ b/libc/string/sys_siglist.c
@@ -31,7 +31,7 @@ const char *const sys_siglist[_NSIG] = {
[SIGPIPE] = _string_syssigmsgs + 178,
[SIGALRM] = _string_syssigmsgs + 190,
[SIGTERM] = _string_syssigmsgs + 202,
-#if !(defined(__alpha__) || defined(__mips__) || defined(__sparc__))
+#if defined SIGSTKFLT /* not all arches define this, yeah ! */
[SIGSTKFLT] = _string_syssigmsgs + 213,
#endif
[SIGCHLD] = _string_syssigmsgs + 225,
@@ -49,7 +49,7 @@ const char *const sys_siglist[_NSIG] = {
[SIGIO] = _string_syssigmsgs + 445,
[SIGPWR] = _string_syssigmsgs + 458,
[SIGSYS] = _string_syssigmsgs + 472,
-#if defined(__alpha__) || defined(__mips__) || defined(__hppa__) || defined(__sparc__)
+#if defined SIGEMT /* only some arches define this, yeah ! */
[SIGEMT] = _string_syssigmsgs + 488,
#endif
};