delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/03/08/04:51:39

Date: Sat, 08 Mar 2003 11:41:52 +0200
From: "Eli Zaretskii" <eliz AT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: rich AT phekda DOT freeserve DOT co DOT uk
Message-Id: <6137-Sat08Mar2003114152+0200-eliz@elta.co.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9
CC: djgpp-workers AT delorie DOT com
In-reply-to: <3E69434C.B420FA9D@phekda.freeserve.co.uk> (message from Richard
Dawe on Sat, 08 Mar 2003 01:11:40 +0000)
Subject: Re: New POSIX: pwrite [PATCH]
References: <E18rMih-00011k-00 AT phekda DOT freeserve DOT co DOT uk> <200303071845 DOT h27Ij5d18334 AT envy DOT delorie DOT com> <3E6938EC DOT D9BFE2E4 AT phekda DOT freeserve DOT co DOT uk> <200303080038 DOT h280crk23683 AT envy DOT delorie DOT com> <3E69434C DOT B420FA9D AT phekda DOT freeserve DOT co DOT uk>
Reply-To: Eli Zaretskii <eliz AT elta DOT co DOT il>
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Sat, 08 Mar 2003 01:11:40 +0000
> From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
> 
> I thought we were talking about how to detect TTYs that have been redirected
> (aka piped), so that we can fail pwrite and set errno == ESPIPE.

As I wrote elsewhere in this thread, I don't see why should pwrite
fail in those cases.  I think it shouldn't: DOS doesn't have real
pipes.

> > Hmmm... probably.  The code in isatty.c looks suspect; it only returns
> > true if a device is both stdin *and* stdout.  It should probably also
> > just check for device vs file.
> 
> I see what you mean. Are all character devices TTYs?

I don't think that every character device should cause `isatty' return
a non-zero value.  Programs that want to detect character devices
should call `stat' and look at the mode bits.  `isatty' should IMHO
return non-zero only for terminal devices.

While the distinction might be very close to moot in DJGPP, it is IMHO
still an important distinction, even if only to avoid user confusion.
For example, consider the character-device interface presented by
memory managers such as EMM386 or QEMM, or by MSCDEX: it would confuse
the heck out of users if `isatty' returned non-zero for them.  I
think.

So I think we should first think whether there are good reasons to
modify `isatty' so it returns non-zero for every character device.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019