From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,6f950f1eae0aaf4b X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1995-01-27 01:49:27 PST Newsgroups: comp.unix.osf.osf1 Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!udel!gatech!howland.reston.ans.net!news.sprintlink.net!hookup!caen!msunews!harbinger.cc.monash.edu.au!yarrina.connect.com.au!gomez!glenn From: glenn@fs.com.au (Glenn Huxtable) Subject: Re: Odd curses bug - redirected stdout. Message-ID: <1995Jan27.094927.9336@fs.com.au> Organization: Functional Software, Perth, Australia X-Newsreader: NN version 6.5.0 #22 References: <1995Jan26.110256.21416@fs.com.au> Date: Fri, 27 Jan 1995 09:49:27 GMT glenn@fs.com.au (Glenn Huxtable) writes: >Can anyone explain this wierd behaviour of OSF1 curses? >Curses fails to honour 'nonl', 'noecho' and 'cbreak' (at least) if >stdout has been redirected? >Before you say that I'm silly to expect curses to work if stdout is redirected, >let me say "it fails even if stdout is redirected to stdout!" ... well, I still haven't solved this problem, but I've narrowed it down further. The failing curses routines are calling an ioctl TCSETAW, which drains the output before setting the 'termio' structure. If stdout is redirected to either '/dev/tty' or to the real terminal (ie /dev/ttyp1), then the ioctl returns errno = 13 (EPERM or Permission denied). This should not be so. I own the terminal, it's mode 666 (just to be sure) and it's *exactly* the same device that stdout was pointing to before it was redirected. I've checked other things such as process groups, session groups, controlling terminal, and they are all the same as in the case where stdout has not been redirected (and the test program succeeds). an anyone explain this unusual behaviour of TCSETAW? Better still, can anyone suggest how I can fix it so that curses (and ioctl) think the redirected terminal is ok, and have this TCSETAW succeed? glenn -- Email - glenn@fs.com.au ,-_|\ glenn huxtable phone - +61 9 328 8288 / \ functional software fax - +61 9 328 8616 *_,-._/ PO box 192 v leederville WA 6903