about summary refs log tree commit diff stats
path: root/src/wrapped/wrappedlibc.c
diff options
context:
space:
mode:
authorYang Liu <liuyang22@iscas.ac.cn>2024-12-25 22:28:29 +0800
committerGitHub <noreply@github.com>2024-12-25 15:28:29 +0100
commit91a8fef1bba2b5e398efcfab6c94ba757b34c32c (patch)
tree99d0d74080366360a1169aeaf6a3656b392fd24e /src/wrapped/wrappedlibc.c
parenta56a66a2270dbdfdb8ad4febb4b58bdc028eceb2 (diff)
downloadbox64-91a8fef1bba2b5e398efcfab6c94ba757b34c32c.tar.gz
box64-91a8fef1bba2b5e398efcfab6c94ba757b34c32c.zip
[WRAPPED] Always return ENOSYS in the deprecated sysctl (#2204)
Diffstat (limited to 'src/wrapped/wrappedlibc.c')
-rw-r--r--src/wrapped/wrappedlibc.c18
1 files changed, 18 insertions, 0 deletions
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 <sys/sysctl.h> 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;