]>
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 MODULE_INIT_COMPRESSED_FILE
19 # define MODULE_INIT_COMPRESSED_FILE 4
22 #ifndef __NR_finit_module
23 # define __NR_finit_module -1
26 #ifndef HAVE_FINIT_MODULE
29 static inline int finit_module(int fd
, const char *uargs
, int flags
)
31 if (__NR_finit_module
== -1) {
36 return syscall(__NR_finit_module
, fd
, uargs
, flags
);
40 #if !HAVE_DECL_STRNDUPA
41 #define strndupa(s, n) \
43 const char *__old = (s); \
44 size_t __len = strnlen(__old, (n)); \
45 char *__new = alloca(__len + 1); \
46 __new[__len] = '\0'; \
47 memcpy(__new, __old, __len); \
51 #if !HAVE_DECL_BE32TOH
54 #if __BYTE_ORDER == __LITTLE_ENDIAN
55 #define be32toh(x) bswap_32 (x)
57 #define be32toh(x) (x)