From 2cf9eb6c4ead758c0083a30460e3244fab92f268 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Mon, 16 Dec 2019 20:15:44 +0000 Subject: [PATCH] Add a hack to make ^T work for Linux binaries, enabled with 'compat.linux.preserve_vstatus=1' sysctl. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21967 --- share/man/man4/linux.4 | 8 ++++++++ sys/compat/linux/linux_ioctl.c | 4 ++++ sys/compat/linux/linux_ioctl.h | 1 + sys/compat/linux/linux_mib.c | 4 ++++ sys/compat/linux/linux_mib.h | 2 ++ 5 files changed, 19 insertions(+) diff --git a/share/man/man4/linux.4 b/share/man/man4/linux.4 index 04e7a82585f7..997dc16d7692 100644 --- a/share/man/man4/linux.4 +++ b/share/man/man4/linux.4 @@ -109,6 +109,14 @@ Recent versions of GNU libc are known to use different syscalls depending on the value of this sysctl. .It Va compat.linux.oss_version Linux Open Sound System version. +.It Va compat.linux.preserve_vstatus +When set to 1, it prevents Linux applications from resetting the +.Xr termios 4 +VSTATUS setting. +From a user perspective, this makes +.Va SIGINFO +work for Linux executables. +Defaults to 0. .Sh FILES .Bl -tag -width /compat/linux/dev/shm -compact .It Pa /compat/linux diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index d33ddd2bab88..75714cd3d3f2 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -500,6 +500,8 @@ bsd_to_linux_termios(struct termios *bios, struct linux_termios *lios) lios->c_cc[LINUX_VDISCARD] = bios->c_cc[VDISCARD]; lios->c_cc[LINUX_VWERASE] = bios->c_cc[VWERASE]; lios->c_cc[LINUX_VLNEXT] = bios->c_cc[VLNEXT]; + if (linux_preserve_vstatus) + lios->c_cc[LINUX_VSTATUS] = bios->c_cc[VSTATUS]; for (i=0; ic_cc[VDISCARD] = lios->c_cc[LINUX_VDISCARD]; bios->c_cc[VWERASE] = lios->c_cc[LINUX_VWERASE]; bios->c_cc[VLNEXT] = lios->c_cc[LINUX_VLNEXT]; + if (linux_preserve_vstatus) + bios->c_cc[VSTATUS] = lios->c_cc[LINUX_VSTATUS]; for (i=0; i= LINUX_KERNVER_2006000) +extern int linux_preserve_vstatus; + #endif /* _LINUX_MIB_H_ */