Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!yale!mintaka!bloom-beacon!morningstar.COM!karl From: karl@morningstar.COM Newsgroups: comp.windows.x Subject: (none) Message-ID: <9001172246.AA05046@remora.MorningStar.Com> Date: 17 Jan 90 22:46:42 GMT Sender: root@athena.mit.edu (Wizard A. Root) Reply-To: karl@morningstar.com (Karl Fox) Organization: The Internet Lines: 57 X Window System Bug Report xbugs@expo.lcs.mit.edu VERSION: R4 CLIENT MACHINE and OPERATING SYSTEM: Sun 4/60 running SunOS 4.0.3c, Masscomp MC5500 running RTU 4.0A DISPLAY TYPE: Sun bwtwo WINDOW MANAGER: gwm AREA: XTerm SYNOPSIS: /dev/tty doesn't work on System V systems DESCRIPTION: System V systems differ from Berkeley systems in the way that TTY line discipline opens decide whether or not to make the current device the controlling tty. Berkeley systems want proc.p_pgrp == 0; System V systems want proc.p_pgrp == proc.p_pid. REPEAT BY: Start xterm; do: echo stuff > /dev/tty /dev/tty's open returns ENODEV. SAMPLE FIX: If the Berkeley way doesn't work, try the System V way: *** /usr/local/src/X.V11R4/mit/clients/xterm/main.c Fri Jan 12 16:38:16 1990 --- ./main.c Tue Jan 16 12:19:53 1990 *************** *** 1722,1727 **** --- 1722,1734 ---- ioctl(0, TIOCSPGRP, (char *)&pgrp); setpgrp(0,0); close(open(ttydev, O_WRONLY, 0)); + if ((i = open("/dev/tty", O_WRONLY, 0)) >= 0) + close(i); + else + { + setpgrp(0, pgrp); + close(open(ttydev, O_WRONLY, 0)); + } setpgrp (0, pgrp); #endif /* USE_SYSV_PGRP */