summaryrefslogtreecommitdiff
path: root/libbb/qmodule.c
diff options
context:
space:
mode:
authorTim Riker2002-12-14 01:58:59 +0000
committerTim Riker2002-12-14 01:58:59 +0000
commitcf93274663877cb4d722a23d8c418470eb90332a (patch)
treea056983d1162502b58e2aca4c2ebf3c9c7b9c6be /libbb/qmodule.c
parent6fe1960ff5e4c7c993a8bc3add5361ee55323afe (diff)
downloadbusybox-cf93274663877cb4d722a23d8c418470eb90332a.zip
busybox-cf93274663877cb4d722a23d8c418470eb90332a.tar.gz
rmmod -a removed modules recursively
Diffstat (limited to 'libbb/qmodule.c')
-rw-r--r--libbb/qmodule.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/libbb/qmodule.c b/libbb/qmodule.c
new file mode 100644
index 0000000..fd14d10
--- /dev/null
+++ b/libbb/qmodule.c
@@ -0,0 +1,29 @@
+/*
+ Copyright (C) 2002 Tim Riker <Tim@Rikers.org>
+ everyone seems to claim it someplace. ;-)
+*/
+
+#include <errno.h>
+
+#include "libbb.h"
+
+int query_module(const char *name, int which, void *buf, size_t bufsize, size_t *ret);
+
+int my_query_module(const char *name, int which, void **buf,
+ size_t *bufsize, size_t *ret)
+{
+ int my_ret;
+
+ my_ret = query_module(name, which, *buf, *bufsize, ret);
+
+ if (my_ret == -1 && errno == ENOSPC) {
+ *buf = xrealloc(*buf, *ret);
+ *bufsize = *ret;
+
+ my_ret = query_module(name, which, *buf, *bufsize, ret);
+ }
+
+ return my_ret;
+}
+
+