]>
Commit | Line | Data |
---|---|---|
1407064e LDM |
1 | #pragma once |
2 | ||
55112d19 LDM |
3 | #include <unistd.h> |
4 | #include <sys/syscall.h> | |
5 | ||
1407064e LDM |
6 | #ifdef HAVE_LINUX_MODULE_H |
7 | #include <linux/module.h> | |
8 | #endif | |
9 | ||
10 | #ifndef MODULE_INIT_IGNORE_MODVERSIONS | |
11 | # define MODULE_INIT_IGNORE_MODVERSIONS 1 | |
12 | #endif | |
13 | ||
14 | #ifndef MODULE_INIT_IGNORE_VERMAGIC | |
15 | # define MODULE_INIT_IGNORE_VERMAGIC 2 | |
16 | #endif | |
55112d19 | 17 | |
03f7dfb8 LDM |
18 | #ifndef __NR_finit_module |
19 | # define __NR_finit_module -1 | |
20 | #endif | |
21 | ||
55112d19 | 22 | #ifndef HAVE_FINIT_MODULE |
5eac795b JL |
23 | #include <errno.h> |
24 | ||
55112d19 LDM |
25 | static inline int finit_module(int fd, const char *uargs, int flags) |
26 | { | |
5eac795b JL |
27 | if (__NR_finit_module == -1) { |
28 | errno = ENOSYS; | |
29 | return -1; | |
30 | } | |
31 | ||
55112d19 LDM |
32 | return syscall(__NR_finit_module, fd, uargs, flags); |
33 | } | |
34 | #endif |