Subject: COMPAT_LINUX: terminal emulation and signals
To: None <tech-kern@netbsd.org>
From: Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr>
List: tech-kern
Date: 05/19/2001 22:14:18
Hello

I'm trying to fix Linux emulation so that Linux's GDB work on the
PowerPC. Currently, it does not fail because of problems in ptrace(),
but just because of a terminal emulation inconsistency:

GDB uses ioctl TCSETSW on the terminal to set some parameters in the
struct termios. Our emulation of Linux's TCSETSW uses TIOCSETAW in
sys/kern/tty_ioctl.c.

The problem is that TIOSETAW checks the c_ospeed flag of struct termios
and hang up the terminal (it sends a SIGHUP to the session leader) if it
is null. On i386, there is no c_ospeed in the Linux struct termios,
hence no problem. However, on other ports, this field exists, and Linux
has a zero in it. This causes the session to hang up when Linux ioctl
TCSETSW is called in the emulated binary. That's bad :o/

I'm looking for a good idea to fix this. Would it be acceptable to
modify bsd_termios_to_linux_termios() so that a fake c_ospeed is set up
before TIOSETAW tries to do his job? Isn't there a risk to break
something else here?

Or maybe I should save c_ospeed and replace it by a non null value
before calling TIOSETAW, and restore it afterwards?

The latter options seems better to me. Any opinion?

--=20
Emmanuel Dreyfus. =20
Vous avez deplac=E9 la souris.=20
Windows NT doit maintenant redemarrer pour valider les modifications.
p99dreyf@criens.u-psud.fr