Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1 | #include "defs.h" |
| 2 | |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 3 | #if defined(LINUX) |
| 4 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 5 | #include <fcntl.h> |
| 6 | #include <sys/stat.h> |
| 7 | #include <sys/time.h> |
| 8 | #include <sys/wait.h> |
| 9 | #include <sys/resource.h> |
| 10 | #include <sys/utsname.h> |
| 11 | #include <sys/user.h> |
| 12 | #include <sys/syscall.h> |
| 13 | #include <signal.h> |
| 14 | #include <linux/module.h> |
| 15 | |
| 16 | /* WTA: #define these here: since Debian uses glibc2's includefiles |
| 17 | * instead of the kernel includes we miss these otherwise. |
| 18 | */ |
| 19 | |
| 20 | #if !defined(QM_MODULES) |
| 21 | #define QM_MODULES 1 |
| 22 | #define QM_DEPS 2 |
| 23 | #define QM_REFS 3 |
| 24 | #define QM_SYMBOLS 4 |
| 25 | #define QM_INFO 5 |
| 26 | #endif |
| 27 | |
| 28 | static struct xlat which[] = { |
| 29 | { 0, "0" }, |
| 30 | { QM_MODULES, "QM_MODULES" }, |
| 31 | { QM_DEPS, "QM_DEPS" }, |
| 32 | { QM_REFS, "QM_REFS" }, |
| 33 | { QM_SYMBOLS, "QM_SYMBOLS" }, |
| 34 | { QM_INFO, "QM_INFO" }, |
| 35 | { 0, NULL }, |
| 36 | }; |
| 37 | |
| 38 | int |
| 39 | sys_query_module(tcp) |
| 40 | struct tcb *tcp; |
| 41 | { |
| 42 | |
Wichert Akkerman | 5052482 | 1999-10-10 22:40:07 +0000 | [diff] [blame] | 43 | if (exiting(tcp)) { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 44 | printstr(tcp, tcp->u_arg[0], -1); |
| 45 | tprintf(", "); |
| 46 | printxval(which, tcp->u_arg[1], "L_???"); |
| 47 | tprintf(", "); |
| 48 | printstr(tcp, tcp->u_arg[2], tcp->u_arg[3]); |
| 49 | tprintf(", %#lx", tcp->u_arg[4]); |
| 50 | } |
| 51 | return 0; |
| 52 | } |
| 53 | |
Wichert Akkerman | 5052482 | 1999-10-10 22:40:07 +0000 | [diff] [blame] | 54 | int |
| 55 | sys_create_module(tcp) |
| 56 | struct tcb *tcp; |
| 57 | { |
| 58 | if (entering(tcp)) { |
| 59 | printpath(tcp, tcp->u_arg[0]); |
| 60 | tprintf(", %lu", tcp->u_arg[1]); |
| 61 | } |
| 62 | return RVAL_HEX; |
| 63 | } |
| 64 | |
Wichert Akkerman | 2f473da | 1999-11-01 19:53:31 +0000 | [diff] [blame] | 65 | int |
| 66 | sys_init_module(tcp) |
| 67 | struct tcb *tcp; |
| 68 | { |
| 69 | if (entering(tcp)) { |
| 70 | printpath(tcp, tcp->u_arg[0]); |
| 71 | tprintf(", %#lx", tcp->u_arg[1]); |
| 72 | } |
| 73 | return 0; |
| 74 | } |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 75 | #endif /* LINUX */ |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 76 | |