summaryrefslogtreecommitdiffstats
path: root/libc/sysdeps/linux/common
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common')
-rw-r--r--libc/sysdeps/linux/common/bits/kernel_sigaction.h43
-rw-r--r--libc/sysdeps/linux/common/create_module.c21
-rw-r--r--libc/sysdeps/linux/common/get_kernel_syms.c4
-rw-r--r--libc/sysdeps/linux/common/getrusage.c2
4 files changed, 25 insertions, 45 deletions
diff --git a/libc/sysdeps/linux/common/bits/kernel_sigaction.h b/libc/sysdeps/linux/common/bits/kernel_sigaction.h
index 6eaf61f1d..5baf1e224 100644
--- a/libc/sysdeps/linux/common/bits/kernel_sigaction.h
+++ b/libc/sysdeps/linux/common/bits/kernel_sigaction.h
@@ -4,36 +4,9 @@
/* This file provides whatever this particular arch's kernel thinks
* the sigaction struct should look like... */
-#if defined(__alpha__)
-#undef HAVE_SA_RESTORER
-/* This is the sigaction struction from the Linux 2.1.20 kernel. */
-struct old_kernel_sigaction {
- __sighandler_t k_sa_handler;
- unsigned long sa_mask;
- unsigned int sa_flags;
-};
-/* This is the sigaction structure from the Linux 2.1.68 kernel. */
-struct kernel_sigaction {
- __sighandler_t k_sa_handler;
- unsigned int sa_flags;
- sigset_t sa_mask;
-};
-#elif defined(__hppa__)
-#undef HAVE_SA_RESTORER
-/* This is the sigaction struction from the Linux 2.1.20 kernel. */
-/* Blah. This is bogus. We don't ever use it. */
-struct old_kernel_sigaction {
- __sighandler_t k_sa_handler;
- unsigned long sa_mask;
- unsigned long sa_flags;
-};
-/* This is the sigaction structure from the Linux 2.1.68 kernel. */
-struct kernel_sigaction {
- __sighandler_t k_sa_handler;
- unsigned long sa_flags;
- sigset_t sa_mask;
-};
-#elif defined(__mips__)
+#undef NO_OLD_SIGACTION
+
+#if defined(__mips__)
#undef HAVE_SA_RESTORER
/* This is the sigaction structure from the Linux 2.1.24 kernel. */
#include <sgidefs.h>
@@ -58,6 +31,14 @@ struct kernel_sigaction {
void (*sa_restorer)(void);
int s_resv[1]; /* reserved */
};
+#elif defined(__ia64__)
+#define NO_OLD_SIGACTION
+#undef HAVE_SA_RESTORER
+struct kernel_sigaction {
+ __sighandler_t k_sa_handler;
+ unsigned long sa_flags;
+ sigset_t sa_mask;
+};
#else
#define HAVE_SA_RESTORER
/* This is the sigaction structure from the Linux 2.1.20 kernel. */
@@ -76,8 +57,10 @@ struct kernel_sigaction {
};
#endif
+#ifndef NO_OLD_SIGACTION
extern int __syscall_sigaction (int, const struct old_kernel_sigaction *__unbounded,
struct old_kernel_sigaction *__unbounded);
+#endif
extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *__unbounded,
struct kernel_sigaction *__unbounded, size_t);
diff --git a/libc/sysdeps/linux/common/create_module.c b/libc/sysdeps/linux/common/create_module.c
index e37f8e804..0c8f50999 100644
--- a/libc/sysdeps/linux/common/create_module.c
+++ b/libc/sysdeps/linux/common/create_module.c
@@ -27,19 +27,17 @@
#include <sys/syscall.h>
-//#define __NR_create_module 127
-
#ifdef __NR_create_module
#if defined(__i386__) || defined(__m68k__) || defined(__arm__) || defined(__thumb__) || defined(__cris__) || defined(__i960__)
-#define __NR___create_module __NR_create_module
-#ifdef __STR_NR_create_module
-#define __STR_NR___create_module __STR_NR_create_module
-#endif
+# define __NR___create_module __NR_create_module
+# ifdef __STR_NR_create_module
+# define __STR_NR___create_module __STR_NR_create_module
+# endif
_syscall2(long, __create_module, const char *, name, size_t, size);
/* By checking the value of errno, we know if we have been fooled
* by the syscall2 macro making a very high address look like a
- * negaitive, so we we fix it up here. */
+ * negative, so we we fix it up here. */
unsigned long create_module(const char *name, size_t size)
{
long ret = __create_module(name, size);
@@ -52,7 +50,7 @@ unsigned long create_module(const char *name, size_t size)
return ret;
}
#elif defined(__alpha__)
-#define __NR___create_module __NR_create_module
+# define __NR___create_module __NR_create_module
/* Alpha doesn't have the same problem, exactly, but a bug in older
kernels fails to clear the error flag. Clear it here explicitly. */
_syscall4(unsigned long, __create_module, const char *, name,
@@ -66,11 +64,10 @@ unsigned long create_module(const char *name, size_t size)
_syscall2(unsigned long, create_module, const char *, name, size_t, size);
#endif
-#else
-unsigned long create_module(const char *name, size_t size)
+#else /* !__NR_create_module */
+caddr_t create_module(const char *name, size_t size)
{
__set_errno(ENOSYS);
- return (unsigned long)-1;
+ return (caddr_t)-1;
}
#endif
-
diff --git a/libc/sysdeps/linux/common/get_kernel_syms.c b/libc/sysdeps/linux/common/get_kernel_syms.c
index ae19cd2c7..92a105ebd 100644
--- a/libc/sysdeps/linux/common/get_kernel_syms.c
+++ b/libc/sysdeps/linux/common/get_kernel_syms.c
@@ -9,13 +9,13 @@
#include "syscalls.h"
-#ifdef __NR_get_kernel_syms
struct kernel_sym;
+#ifdef __NR_get_kernel_syms
_syscall1(int, get_kernel_syms, struct kernel_sym *, table);
#else
int get_kernel_syms(struct kernel_sym *table)
{
__set_errno(ENOSYS);
- return (unsigned long)-1;
+ return -1;
}
#endif
diff --git a/libc/sysdeps/linux/common/getrusage.c b/libc/sysdeps/linux/common/getrusage.c
index f0476352c..c6aa5a95e 100644
--- a/libc/sysdeps/linux/common/getrusage.c
+++ b/libc/sysdeps/linux/common/getrusage.c
@@ -10,4 +10,4 @@
#include "syscalls.h"
#include <unistd.h>
#include <wait.h>
-_syscall2(int, getrusage, int, who, struct rusage *, usage);
+_syscall2(int, getrusage, __rusage_who_t, who, struct rusage *, usage);