summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2021-09-27 22:46:47 +0200
committerChristian Persch <chpe@src.gnome.org>2021-09-27 22:46:47 +0200
commit91123bb5201156e3d3adbe24305488f5eea2c8d7 (patch)
tree4f58497f596f80f7cd7866a157fa881c2bbc5a6d
parent231dd818fcca839f21a1031497b37b7142a12645 (diff)
downloadvte-91123bb5201156e3d3adbe24305488f5eea2c8d7.tar.gz
build: Fix build with kernel headers from linux < 4.13
We already support running with a kernel that doesn't support this ioctl, so let's also support building with one. Add the missing ioctl definition to missing.hh. Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/2514
-rw-r--r--src/missing.hh12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/missing.hh b/src/missing.hh
index e5a58727..7902e41e 100644
--- a/src/missing.hh
+++ b/src/missing.hh
@@ -23,11 +23,14 @@
#include <fcntl.h>
#ifdef __linux__
+
+#include <sys/ioctl.h>
#include <sys/syscall.h>
#if defined(__mips__) || defined(__mips64__)
#include <asm/sgidefs.h>
#endif
+
#endif
/* NSIG isn't in POSIX, so if it doesn't exist use this here. See bug #759196 */
@@ -128,4 +131,13 @@ char* strchrnul(char const* s,
#define CLOSE_RANGE_CLOEXEC (1u << 2)
#endif
+#if !defined(TIOCGPTPEER)
+/* See linux commit 54ebbfb1603415d9953c150535850d30609ef077 */
+#if defined(__sparc__)
+#define TIOCGPTPEER _IOR('t', 137, int)
+#else
+#define TIOCGPTPEER _IOR('T', 0x41, int)
+#endif
+#endif /* !TIOCGPTPEER */
+
#endif /* __linux__ */