summaryrefslogtreecommitdiffstats
path: root/system/nvidia-driver/nvidia-installer-removed-sysctl-h.patch
diff options
context:
space:
mode:
Diffstat (limited to 'system/nvidia-driver/nvidia-installer-removed-sysctl-h.patch')
-rw-r--r--system/nvidia-driver/nvidia-installer-removed-sysctl-h.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/system/nvidia-driver/nvidia-installer-removed-sysctl-h.patch b/system/nvidia-driver/nvidia-installer-removed-sysctl-h.patch
new file mode 100644
index 0000000000..7b230fcb11
--- /dev/null
+++ b/system/nvidia-driver/nvidia-installer-removed-sysctl-h.patch
@@ -0,0 +1,36 @@
+diff -Naur nvidia-installer-460.67.orig/kernel.c nvidia-installer-460.67/kernel.c
+--- nvidia-installer-460.67.orig/kernel.c 2021-03-10 19:24:00.000000000 -0500
++++ nvidia-installer-460.67/kernel.c 2021-04-16 17:59:48.828574898 -0400
+@@ -23,7 +23,10 @@
+ #include <sys/utsname.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+-#include <sys/sysctl.h>
++#include <gnu/libc-version.h>
++#if __GLIBC__ == 2 && __GLIBC_MINOR__ <= 30
++ #include <sys/sysctl.h>
++#endif
+ #include <ctype.h>
+ #include <stdlib.h>
+ #include <dirent.h>
+@@ -1076,7 +1079,8 @@
+ }
+
+ if (!loglevel_set) {
+- /*
++#if __GLIBC__ == 2 && __GLIBC_MINOR__ <= 30
++ /*
+ * Explicitly initialize the value of len, even though it looks like the
+ * syscall should do that, since in practice it doesn't always actually
+ * set the value of the pointed-to length parameter.
+@@ -1090,6 +1094,10 @@
+ loglevel_set = TRUE;
+ }
+ }
++#else /* sys/sysctl.h has been removed from glibc 2.32 and later */
++ if (!old_level)
++ loglevel_set = TRUE;
++#endif
+ }
+
+ return loglevel_set;