kmod/libkmod/missing.h
Lucas De Marchi 38829712e5 missing: Don't call syscall() with syscallno == -1
Reported-by: Jean-Francis Roy <jeanfrancis@funtoo.org>
Reported-by: Jan Luebbe <jlu@pengutronix.de>
2013-05-02 17:02:52 -03:00

30 lines
540 B
C

#pragma once
#include <errno.h>
#include <unistd.h>
#include <sys/syscall.h>
#ifdef HAVE_LINUX_MODULE_H
#include <linux/module.h>
#endif
#ifndef MODULE_INIT_IGNORE_MODVERSIONS
# define MODULE_INIT_IGNORE_MODVERSIONS 1
#endif
#ifndef MODULE_INIT_IGNORE_VERMAGIC
# define MODULE_INIT_IGNORE_VERMAGIC 2
#endif
#ifndef HAVE_FINIT_MODULE
static inline int finit_module(int fd, const char *uargs, int flags)
{
#ifndef __NR_finit_module
errno = ENOSYS;
return -1;
#else
return syscall(__NR_finit_module, fd, uargs, flags);
#endif
}
#endif