diff options
Diffstat (limited to 'modutils')
-rw-r--r-- | modutils/insmod.c | 43 |
1 files changed, 3 insertions, 40 deletions
diff --git a/modutils/insmod.c b/modutils/insmod.c index ad1486b7b..c2ebd2e24 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -60,8 +60,6 @@ | |||
60 | #include <string.h> | 60 | #include <string.h> |
61 | #include <getopt.h> | 61 | #include <getopt.h> |
62 | #include <sys/utsname.h> | 62 | #include <sys/utsname.h> |
63 | #include <sys/syscall.h> | ||
64 | #include <linux/unistd.h> | ||
65 | #include "busybox.h" | 63 | #include "busybox.h" |
66 | 64 | ||
67 | #if defined(__powerpc__) | 65 | #if defined(__powerpc__) |
@@ -119,7 +117,7 @@ | |||
119 | #ifndef MODUTILS_MODULE_H | 117 | #ifndef MODUTILS_MODULE_H |
120 | static const int MODUTILS_MODULE_H = 1; | 118 | static const int MODUTILS_MODULE_H = 1; |
121 | 119 | ||
122 | #ident "$Id: insmod.c,v 1.54 2001/04/05 03:14:39 andersen Exp $" | 120 | #ident "$Id: insmod.c,v 1.55 2001/04/05 06:08:14 andersen Exp $" |
123 | 121 | ||
124 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 122 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
125 | We do not use the kernel headers directly because we do not wish | 123 | We do not use the kernel headers directly because we do not wish |
@@ -325,7 +323,7 @@ int delete_module(const char *); | |||
325 | #ifndef MODUTILS_OBJ_H | 323 | #ifndef MODUTILS_OBJ_H |
326 | static const int MODUTILS_OBJ_H = 1; | 324 | static const int MODUTILS_OBJ_H = 1; |
327 | 325 | ||
328 | #ident "$Id: insmod.c,v 1.54 2001/04/05 03:14:39 andersen Exp $" | 326 | #ident "$Id: insmod.c,v 1.55 2001/04/05 06:08:14 andersen Exp $" |
329 | 327 | ||
330 | /* The relocatable object is manipulated using elfin types. */ | 328 | /* The relocatable object is manipulated using elfin types. */ |
331 | 329 | ||
@@ -674,20 +672,8 @@ int n_ext_modules; | |||
674 | int n_ext_modules_used; | 672 | int n_ext_modules_used; |
675 | 673 | ||
676 | 674 | ||
677 | |||
678 | /* Some firendly syscalls to cheer everyone's day... */ | ||
679 | #define __NR_new_sys_init_module __NR_init_module | ||
680 | _syscall2(int, new_sys_init_module, const char *, name, | ||
681 | const struct new_module *, info) | ||
682 | #define __NR_old_sys_init_module __NR_init_module | ||
683 | _syscall5(int, old_sys_init_module, const char *, name, char *, code, | ||
684 | unsigned, codesize, struct old_mod_routines *, routines, | ||
685 | struct old_symbol_table *, symtab) | ||
686 | #ifndef BB_RMMOD | ||
687 | _syscall1(int, delete_module, const char *, name) | ||
688 | #else | ||
689 | extern int delete_module(const char *); | 675 | extern int delete_module(const char *); |
690 | #endif | 676 | |
691 | 677 | ||
692 | /* This is kind of troublesome. See, we don't actually support | 678 | /* This is kind of troublesome. See, we don't actually support |
693 | the m68k or the arm the same way we support i386 and (now) | 679 | the m68k or the arm the same way we support i386 and (now) |
@@ -700,29 +686,6 @@ extern int delete_module(const char *); | |||
700 | 686 | ||
701 | -- Bryan Rittmeyer <bryan@ixiacom.com> */ | 687 | -- Bryan Rittmeyer <bryan@ixiacom.com> */ |
702 | 688 | ||
703 | #ifdef BB_FEATURE_OLD_MODULE_INTERFACE | ||
704 | _syscall1(int, get_kernel_syms, struct old_kernel_sym *, ks) | ||
705 | #endif | ||
706 | |||
707 | #if defined(__i386__) || defined(__m68k__) || defined(__arm__) \ | ||
708 | || defined(__powerpc__) | ||
709 | /* Jump through hoops to fixup error return codes */ | ||
710 | #define __NR__create_module __NR_create_module | ||
711 | static inline _syscall2(long, _create_module, const char *, name, size_t, | ||
712 | size) | ||
713 | unsigned long create_module(const char *name, size_t size) | ||
714 | { | ||
715 | long ret = _create_module(name, size); | ||
716 | |||
717 | if (ret == -1 && errno > 125) { | ||
718 | ret = -errno; | ||
719 | errno = 0; | ||
720 | } | ||
721 | return ret; | ||
722 | } | ||
723 | #else | ||
724 | _syscall2(unsigned long, create_module, const char *, name, size_t, size) | ||
725 | #endif | ||
726 | static char m_filename[BUFSIZ + 1]; | 689 | static char m_filename[BUFSIZ + 1]; |
727 | static char m_fullName[BUFSIZ + 1]; | 690 | static char m_fullName[BUFSIZ + 1]; |
728 | 691 | ||