From 91a8fef1bba2b5e398efcfab6c94ba757b34c32c Mon Sep 17 00:00:00 2001 From: Yang Liu Date: Wed, 25 Dec 2024 22:28:29 +0800 Subject: [WRAPPED] Always return ENOSYS in the deprecated sysctl (#2204) --- src/wrapped/wrappedlibc.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/wrapped/wrappedlibc.c') diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 3db583cf..79dcca62 100644 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -1531,6 +1531,24 @@ EXPORT void* my_tsearch(x64emu_t* emu, void* key, void* root, void* fnc) (void)emu; return tsearch(key, root, findcompareFct(fnc)); } + +EXPORT int my___sysctl(x64emu_t* emu, int* name, int nlen, void* oldval, size_t* oldlenp, void* newval, size_t newlen) +{ + return ENOSYS; +} + +EXPORT int my_sysctl(x64emu_t* emu, int* name, int nlen, void* oldval, size_t* oldlenp, void* newval, size_t newlen) +{ + /* Glibc 2.32 Release note. + The deprecated header and the sysctl function have been + removed. To support old binaries, the sysctl function continues to + exist as a compatibility symbol (on those architectures which had it), + but always fails with ENOSYS. This reflects the removal of the system + call from all architectures, starting with Linux 5.5. + */ + return ENOSYS; +} + EXPORT void my_tdestroy(x64emu_t* emu, void* root, void* fnc) { (void)emu; -- cgit 1.4.1