1 From f60f9d6f1f73ab3f77771dafa4f90c2e0de2a7e2 Mon Sep 17 00:00:00 2001
2 From: Waldemar Brodkorb <wbx@uclibc-ng.org>
3 Date: Tue, 27 Dec 2016 09:24:24 +0100
4 Subject: [PATCH] add init_module/delete_module syscall wrappers
6 Add the wrappers unconditionally, because kmod package
9 Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
11 libc/sysdeps/linux/common/Makefile.in | 1 +
12 libc/sysdeps/linux/common/module.c | 23 +++++++++++++++++++++++
13 2 files changed, 24 insertions(+)
14 create mode 100644 libc/sysdeps/linux/common/module.c
16 diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
17 index 595074c..faed6fd 100644
18 --- a/libc/sysdeps/linux/common/Makefile.in
19 +++ b/libc/sysdeps/linux/common/Makefile.in
20 @@ -31,6 +31,7 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
28 diff --git a/libc/sysdeps/linux/common/module.c b/libc/sysdeps/linux/common/module.c
30 index 0000000..146a43e
32 +++ b/libc/sysdeps/linux/common/module.c
35 + * init_module()/delete_module() for uClibc
37 + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
39 + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
42 +#include <sys/syscall.h>
44 +#ifdef __NR_init_module
45 +int init_module(void *first, void *second, void *third, void *fourth, void *fifth);
46 +/* This may have 5 arguments (for old 2.0 kernels) or 2 arguments
47 + * (for 2.2 and 2.4 kernels). Use the greatest common denominator,
48 + * and let the kernel cope with whatever it gets. It's good at that. */
49 +_syscall5(int, init_module, void *, first, void *, second, void *, third,
50 + void *, fourth, void *, fifth)
53 +#ifdef __NR_delete_module
54 +int delete_module(const char *name, unsigned int flags);
55 +_syscall2(int, delete_module, const char *, name, unsigned int, flags)