diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-05-27 10:13:54 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-05-27 10:13:54 +0000 |
commit | 4fec3469668faf0022d32fc195c9451523219cb2 (patch) | |
tree | 35623ba1a802968401c64cfb51b3f31162057d17 /modutils/insmod.c | |
parent | 9cf0f62b15719cbb3b5bcc31ed006a995dd5b0cc (diff) | |
download | busybox-w32-4fec3469668faf0022d32fc195c9451523219cb2.tar.gz busybox-w32-4fec3469668faf0022d32fc195c9451523219cb2.tar.bz2 busybox-w32-4fec3469668faf0022d32fc195c9451523219cb2.zip |
- use (uC)libc functions. Saves a dozen bytes.
Diffstat (limited to 'modutils/insmod.c')
-rw-r--r-- | modutils/insmod.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modutils/insmod.c b/modutils/insmod.c index f7e9a6672..30d471b78 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -4184,8 +4184,14 @@ int insmod_main(int argc, char **argv) | |||
4184 | #if ENABLE_FEATURE_2_6_MODULES | 4184 | #if ENABLE_FEATURE_2_6_MODULES |
4185 | 4185 | ||
4186 | #include <sys/mman.h> | 4186 | #include <sys/mman.h> |
4187 | |||
4188 | #ifdef __UCLIBC__ | ||
4189 | extern int init_module(void *module, unsigned long len, const char *options); | ||
4190 | #else | ||
4187 | #include <asm/unistd.h> | 4191 | #include <asm/unistd.h> |
4188 | #include <sys/syscall.h> | 4192 | #include <sys/syscall.h> |
4193 | #define init_module(mod, len, opts) syscall(__NR_init_module, mod, len, opts) | ||
4194 | #endif | ||
4189 | 4195 | ||
4190 | /* We use error numbers in a loose translation... */ | 4196 | /* We use error numbers in a loose translation... */ |
4191 | static const char *moderror(int err) | 4197 | static const char *moderror(int err) |
@@ -4257,10 +4263,9 @@ static int insmod_ng_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
4257 | map = xmalloc_open_read_close(filename, &len); | 4263 | map = xmalloc_open_read_close(filename, &len); |
4258 | #endif | 4264 | #endif |
4259 | 4265 | ||
4260 | if (syscall(__NR_init_module, map, len, options) != 0) | 4266 | if (init_module(map, len, options) != 0) |
4261 | bb_error_msg_and_die("cannot insert '%s': %s", | 4267 | bb_error_msg_and_die("cannot insert '%s': %s", |
4262 | filename, moderror(errno)); | 4268 | filename, moderror(errno)); |
4263 | |||
4264 | return 0; | 4269 | return 0; |
4265 | } | 4270 | } |
4266 | 4271 | ||