summaryrefslogtreecommitdiff
path: root/modutils/insmod.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2008-05-27 10:13:54 +0000
committerBernhard Reutner-Fischer2008-05-27 10:13:54 +0000
commit4fec3469668faf0022d32fc195c9451523219cb2 (patch)
tree35623ba1a802968401c64cfb51b3f31162057d17 /modutils/insmod.c
parent9cf0f62b15719cbb3b5bcc31ed006a995dd5b0cc (diff)
downloadbusybox-4fec3469668faf0022d32fc195c9451523219cb2.zip
busybox-4fec3469668faf0022d32fc195c9451523219cb2.tar.gz
- use (uC)libc functions. Saves a dozen bytes.
Diffstat (limited to 'modutils/insmod.c')
-rw-r--r--modutils/insmod.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/modutils/insmod.c b/modutils/insmod.c
index f7e9a66..30d471b 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -4184,8 +4184,14 @@ int insmod_main(int argc, char **argv)
#if ENABLE_FEATURE_2_6_MODULES
#include <sys/mman.h>
+
+#ifdef __UCLIBC__
+extern int init_module(void *module, unsigned long len, const char *options);
+#else
#include <asm/unistd.h>
#include <sys/syscall.h>
+#define init_module(mod, len, opts) syscall(__NR_init_module, mod, len, opts)
+#endif
/* We use error numbers in a loose translation... */
static const char *moderror(int err)
@@ -4257,10 +4263,9 @@ static int insmod_ng_main(int argc ATTRIBUTE_UNUSED, char **argv)
map = xmalloc_open_read_close(filename, &len);
#endif
- if (syscall(__NR_init_module, map, len, options) != 0)
+ if (init_module(map, len, options) != 0)
bb_error_msg_and_die("cannot insert '%s': %s",
filename, moderror(errno));
-
return 0;
}