summaryrefslogtreecommitdiff
path: root/modutils/rmmod.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/rmmod.c
parent9cf0f62b15719cbb3b5bcc31ed006a995dd5b0cc (diff)
downloadbusybox-4fec3469668faf0022d32fc195c9451523219cb2.zip
busybox-4fec3469668faf0022d32fc195c9451523219cb2.tar.gz
- use (uC)libc functions. Saves a dozen bytes.
Diffstat (limited to 'modutils/rmmod.c')
-rw-r--r--modutils/rmmod.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/modutils/rmmod.c b/modutils/rmmod.c
index 61cfbd1..a96a274 100644
--- a/modutils/rmmod.c
+++ b/modutils/rmmod.c
@@ -8,7 +8,13 @@
*/
#include "libbb.h"
-#include <sys/syscall.h>
+
+#ifdef __UCLIBC__
+extern int delete_module(const char *module, unsigned int flags);
+#else
+# include <sys/syscall.h>
+# define delete_module(mod, flags) syscall(__NR_delete_module, mod, flags)
+#endif
#if ENABLE_FEATURE_2_6_MODULES
static inline void filename2modname(char *modname, const char *afterslash)
@@ -59,7 +65,7 @@ int rmmod_main(int argc, char **argv)
size_t pnmod = -1; /* previous number of modules */
while (nmod != pnmod) {
- if (syscall(__NR_delete_module, NULL, flags) != 0) {
+ if (delete_module(NULL, flags) != 0) {
if (errno == EFAULT)
return ret;
bb_perror_msg_and_die("rmmod");
@@ -84,7 +90,7 @@ int rmmod_main(int argc, char **argv)
filename2modname(misc_buf, bb_basename(argv[n]));
}
- if (syscall(__NR_delete_module, ENABLE_FEATURE_2_6_MODULES ? misc_buf : argv[n], flags)) {
+ if (delete_module(ENABLE_FEATURE_2_6_MODULES ? misc_buf : argv[n], flags)) {
bb_simple_perror_msg(argv[n]);
ret = EXIT_FAILURE;
}