Reported-by: Jean-Francis Roy <jeanfrancis@funtoo.org>
Reported-by: Jan Luebbe <jlu@pengutronix.de>
#pragma once
+#include <errno.h>
#include <unistd.h>
#include <sys/syscall.h>
# define MODULE_INIT_IGNORE_VERMAGIC 2
#endif
-#ifndef __NR_finit_module
-# define __NR_finit_module -1
-#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