/*
* some system calls possibly missing from libc
*
- * Copyright (C) 1999,2000,2001 by Lineo, inc.
- * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
+ * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
+ * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
_syscall* defined. */
#define __LIBRARY__
#include <sys/syscall.h>
+#if __GNU_LIBRARY__ < 5
+/* This is needed for libc5 */
#include <asm/unistd.h>
+#endif
#include "libbb.h"
-#define __NR_new_sys_init_module __NR_init_module
-_syscall2(int, new_sys_init_module, const char *, name,
- const struct new_module *, info);
-
-#define __NR_old_sys_init_module __NR_init_module
-_syscall5(int, old_sys_init_module, const char *, name, char *, code,
- unsigned, codesize, struct old_mod_routines *, routines,
- struct old_symbol_table *, symtab);
-#if __GNU_LIBRARY__ < 5
+#if __GNU_LIBRARY__ < 5 || ((__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1))
/* These syscalls are not included as part of libc5 */
_syscall1(int, delete_module, const char *, name);
-_syscall1(int, get_kernel_syms, struct old_kernel_sym *, ks);
+_syscall1(int, get_kernel_syms, __ptr_t, ks);
+
+/* This may have 5 arguments (for old 2.0 kernels) or 2 arguments
+ * (for 2.2 and 2.4 kernels). Use the greatest common denominator,
+ * and let the kernel cope with whatever it gets. Its good at that. */
+_syscall5(int, init_module, void *, first, void *, second, void *, third,
+ void *, fourth, void *, fifth);
#ifndef __NR_query_module
#warning This kernel does not support the query_module syscall
#endif
/* Jump through hoops to fixup error return codes */
-#define __NR__create_module __NR_create_module
-static inline _syscall2(long, _create_module, const char *, name, size_t, size)
+#define __NR___create_module __NR_create_module
+static inline _syscall2(long, __create_module, const char *, name, size_t, size)
unsigned long create_module(const char *name, size_t size)
{
- long ret = _create_module(name, size);
+ long ret = __create_module(name, size);
if (ret == -1 && errno > 125) {
ret = -errno;