]>
git.ipfire.org Git - thirdparty/kmod.git/blob - shared/missing.h
4 #include <sys/syscall.h>
6 #ifdef HAVE_LINUX_MODULE_H
7 #include <linux/module.h>
10 #ifndef MODULE_INIT_IGNORE_MODVERSIONS
11 # define MODULE_INIT_IGNORE_MODVERSIONS 1
14 #ifndef MODULE_INIT_IGNORE_VERMAGIC
15 # define MODULE_INIT_IGNORE_VERMAGIC 2
18 #ifndef __NR_finit_module
19 # define __NR_finit_module -1
22 #ifndef HAVE_FINIT_MODULE
25 static inline int finit_module(int fd
, const char *uargs
, int flags
)
27 if (__NR_finit_module
== -1) {
32 return syscall(__NR_finit_module
, fd
, uargs
, flags
);
36 #if !HAVE_DECL_STRNDUPA
37 #define strndupa(s, n) \
39 const char *__old = (s); \
40 size_t __len = strnlen(__old, (n)); \
41 char *__new = alloca(__len + 1); \
42 __new[__len] = '\0'; \
43 memcpy(__new, __old, __len); \
47 #if !HAVE_DECL_BE32TOH
50 #if __BYTE_ORDER == __LITTLE_ENDIAN
51 #define be32toh(x) bswap_32 (x)
53 #define be32toh(x) (x)