1 /* vi: set sw=4 ts=4: */
3 * some system calls possibly missing from libc
5 * Copyright (C) 1999,2000,2001 by Lineo, inc.
6 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 /* Kernel headers before 2.1.mumble need this on the Alpha to get
30 #include <sys/syscall.h>
31 #include <asm/unistd.h>
37 unsigned long module; /* kernel addresses */
41 struct old_module_symbol
47 struct old_symbol_table
49 int size; /* total, including string table!!! */
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 */
56 struct old_mod_routines
59 unsigned long cleanup;
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);
67 #if __GNU_LIBRARY__ < 5
68 /* These syscalls are not included as part of libc5 */
69 _syscall1(int, delete_module, const char *, name);
70 _syscall1(int, get_kernel_syms, struct old_kernel_sym *, ks);
72 #ifndef __NR_query_module
73 #warning This kernel does not support the query_module syscall
74 #warning -> The query_module system call is being stubbed out...
75 int query_module(const char *name, int which, void *buf, size_t bufsize, size_t *ret)
77 fprintf(stderr, "\n\nTo make this application work, you will need to recompile\n");
78 fprintf(stderr, "with a kernel supporting the query_module system call. -Erik\n\n");
83 _syscall5(int, query_module, const char *, name, int, which,
84 void *, buf, size_t, bufsize, size_t*, ret);
87 /* Jump through hoops to fixup error return codes */
88 #define __NR__create_module __NR_create_module
89 static inline _syscall2(long, _create_module, const char *, name, size_t, size)
90 unsigned long create_module(const char *name, size_t size)
92 long ret = _create_module(name, size);
94 if (ret == -1 && errno > 125) {
101 #endif /* __GNU_LIBRARY__ < 5 */
107 c-file-style: "linux"