blob: cf7f4e87650074fc6ae26cacd4e6f2a227424758 [file] [log] [blame]
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001#include "defs.h"
2
Wichert Akkerman2e2553a1999-05-09 00:29:58 +00003#if defined(LINUX)
4
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00005#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
28static 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
38int
39sys_query_module(tcp)
40struct tcb *tcp;
41{
42
Wichert Akkerman50524821999-10-10 22:40:07 +000043 if (exiting(tcp)) {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000044 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 Akkerman50524821999-10-10 22:40:07 +000054int
55sys_create_module(tcp)
56struct 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 Akkerman2f473da1999-11-01 19:53:31 +000065int
66sys_init_module(tcp)
67struct 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 Akkerman2e2553a1999-05-09 00:29:58 +000075#endif /* LINUX */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000076