1From 91123bb5201156e3d3adbe24305488f5eea2c8d7 Mon Sep 17 00:00:00 2001 2From: Christian Persch <chpe@src.gnome.org> 3Date: Mon, 27 Sep 2021 22:46:47 +0200 4Subject: [PATCH] build: Fix build with kernel headers from linux < 4.13 5 6We already support running with a kernel that doesn't support this 7ioctl, so let's also support building with one. Add the missing 8ioctl definition to missing.hh. 9 10Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/2514 11 12[Retrieved from: 13https://gitlab.gnome.org/GNOME/vte/-/commit/91123bb5201156e3d3adbe24305488f5eea2c8d7] 14Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> 15--- 16 src/missing.hh | 12 ++++++++++++ 17 1 file changed, 12 insertions(+) 18 19diff --git a/src/missing.hh b/src/missing.hh 20index e5a58727..7902e41e 100644 21--- a/src/missing.hh 22+++ b/src/missing.hh 23@@ -23,11 +23,14 @@ 24 #include <fcntl.h> 25 26 #ifdef __linux__ 27+ 28+#include <sys/ioctl.h> 29 #include <sys/syscall.h> 30 31 #if defined(__mips__) || defined(__mips64__) 32 #include <asm/sgidefs.h> 33 #endif 34+ 35 #endif 36 37 /* NSIG isn't in POSIX, so if it doesn't exist use this here. See bug #759196 */ 38@@ -128,4 +131,13 @@ char* strchrnul(char const* s, 39 #define CLOSE_RANGE_CLOEXEC (1u << 2) 40 #endif 41 42+#if !defined(TIOCGPTPEER) 43+/* See linux commit 54ebbfb1603415d9953c150535850d30609ef077 */ 44+#if defined(__sparc__) 45+#define TIOCGPTPEER _IOR('t', 137, int) 46+#else 47+#define TIOCGPTPEER _IOR('T', 0x41, int) 48+#endif 49+#endif /* !TIOCGPTPEER */ 50+ 51 #endif /* __linux__ */ 52-- 53GitLab 54 55