aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-05 07:33:10 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-05 07:33:10 +0000
commit64c8b1762c269cd3d6d1bd58ba6cece39f4863cf (patch)
tree1b4ab2d9dd5c889953f911dc1e0ef0c478462b84 /libbb
parentacc7757312fe1a7a69448047d1dbea2ef1c31cde (diff)
downloadbusybox-w32-64c8b1762c269cd3d6d1bd58ba6cece39f4863cf.tar.gz
busybox-w32-64c8b1762c269cd3d6d1bd58ba6cece39f4863cf.tar.bz2
busybox-w32-64c8b1762c269cd3d6d1bd58ba6cece39f4863cf.zip
Another iteration -- adjust the init_module syscall a bit.
-Erik
Diffstat (limited to 'libbb')
-rw-r--r--libbb/module_syscalls.c44
1 files changed, 9 insertions, 35 deletions
diff --git a/libbb/module_syscalls.c b/libbb/module_syscalls.c
index 87662ff21..3a06b21a0 100644
--- a/libbb/module_syscalls.c
+++ b/libbb/module_syscalls.c
@@ -32,43 +32,17 @@
32#include "libbb.h" 32#include "libbb.h"
33 33
34 34
35struct old_module_ref
36{
37 unsigned long module; /* kernel addresses */
38 unsigned long next;
39};
40
41struct old_module_symbol
42{
43 unsigned long addr;
44 unsigned long name;
45};
46
47struct old_symbol_table
48{
49 int size; /* total, including string table!!! */
50 int n_symbols;
51 int n_refs;
52 struct old_module_symbol symbol[0]; /* actual size defined by n_symbols */
53 struct old_module_ref ref[0]; /* actual size defined by n_refs */
54};
55
56struct old_mod_routines
57{
58 unsigned long init;
59 unsigned long cleanup;
60};
61
62#define __NR_old_sys_init_module __NR_init_module
63_syscall5(int, old_sys_init_module, const char *, name, char *, code,
64 unsigned, codesize, struct old_mod_routines *, routines,
65 struct old_symbol_table *, symtab);
66
67#if __GNU_LIBRARY__ < 5 35#if __GNU_LIBRARY__ < 5
68/* These syscalls are not included as part of libc5 */ 36/* These syscalls are not included as part of libc5 */
69_syscall1(int, delete_module, const char *, name); 37_syscall1(int, delete_module, const char *, name);
70_syscall1(int, get_kernel_syms, struct old_kernel_sym *, ks); 38_syscall1(int, get_kernel_syms, struct old_kernel_sym *, ks);
71 39
40/* This may have 5 arguments (for old 2.0 kernels) or 2 arguments
41 * (for 2.2 and 2.4 kernels). Use the greatest common denominator,
42 * and let the kernel cope with whatever it gets. Its good at that. */
43_syscall5(int, init_module, void *, first, void *, second, void *, third,
44 void *, fourth, void *, fifth);
45
72#ifndef __NR_query_module 46#ifndef __NR_query_module
73#warning This kernel does not support the query_module syscall 47#warning This kernel does not support the query_module syscall
74#warning -> The query_module system call is being stubbed out... 48#warning -> The query_module system call is being stubbed out...
@@ -85,11 +59,11 @@ _syscall5(int, query_module, const char *, name, int, which,
85#endif 59#endif
86 60
87/* Jump through hoops to fixup error return codes */ 61/* Jump through hoops to fixup error return codes */
88#define __NR__create_module __NR_create_module 62#define __NR___create_module __NR_create_module
89static inline _syscall2(long, _create_module, const char *, name, size_t, size) 63static inline _syscall2(long, __create_module, const char *, name, size_t, size)
90unsigned long create_module(const char *name, size_t size) 64unsigned long create_module(const char *name, size_t size)
91{ 65{
92 long ret = _create_module(name, size); 66 long ret = __create_module(name, size);
93 67
94 if (ret == -1 && errno > 125) { 68 if (ret == -1 && errno > 125) {
95 ret = -errno; 69 ret = -errno;