summaryrefslogtreecommitdiff
path: root/bjm.c
diff options
context:
space:
mode:
authorWichert Akkerman <wichert@deephackmode.org>1999-02-19 00:21:36 +0000
committerWichert Akkerman <wichert@deephackmode.org>1999-02-19 00:21:36 +0000
commit76baf7c9f6dd61a15524ad43c1b690c252cf5b7c (patch)
treec54cba971a5ca31d262dbf292fdae19601b7833d /bjm.c
downloadstrace-76baf7c9f6dd61a15524ad43c1b690c252cf5b7c.tar.gz
strace-76baf7c9f6dd61a15524ad43c1b690c252cf5b7c.tar.bz2
strace-76baf7c9f6dd61a15524ad43c1b690c252cf5b7c.tar.xz
Initial revision
Diffstat (limited to 'bjm.c')
-rw-r--r--bjm.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/bjm.c b/bjm.c
new file mode 100644
index 0000000..2bb91a9
--- /dev/null
+++ b/bjm.c
@@ -0,0 +1,61 @@
+#include "defs.h"
+
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <sys/resource.h>
+#include <sys/utsname.h>
+#include <sys/user.h>
+#include <sys/syscall.h>
+#include <signal.h>
+#include <linux/module.h>
+
+/* WTA: #define these here: since Debian uses glibc2's includefiles
+ * instead of the kernel includes we miss these otherwise.
+ */
+
+#if !defined(QM_MODULES)
+#define QM_MODULES 1
+#define QM_DEPS 2
+#define QM_REFS 3
+#define QM_SYMBOLS 4
+#define QM_INFO 5
+#endif
+
+static struct xlat which[] = {
+ { 0, "0" },
+ { QM_MODULES, "QM_MODULES" },
+ { QM_DEPS, "QM_DEPS" },
+ { QM_REFS, "QM_REFS" },
+ { QM_SYMBOLS, "QM_SYMBOLS" },
+ { QM_INFO, "QM_INFO" },
+ { 0, NULL },
+};
+
+int
+sys_query_module(tcp)
+struct tcb *tcp;
+{
+
+ if (entering(tcp)) {
+ printstr(tcp, tcp->u_arg[0], -1);
+ tprintf(", ");
+ printxval(which, tcp->u_arg[1], "L_???");
+ tprintf(", ");
+ printstr(tcp, tcp->u_arg[2], tcp->u_arg[3]);
+ tprintf(", %#lx", tcp->u_arg[4]);
+ }
+ return 0;
+}
+
+int
+sys_delete_module(tcp)
+struct tcb *tcp;
+{
+
+ if (entering(tcp)) {
+ printstr(tcp, tcp->u_arg[0], -1);
+ }
+ return 0;
+}