Date: Fri, 7 Mar 2003 19:38:53 -0500 Message-Id: <200303080038.h280crk23683@envy.delorie.com> X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT delorie DOT com using -f From: DJ Delorie To: djgpp-workers AT delorie DOT com In-reply-to: <3E6938EC.D9BFE2E4@phekda.freeserve.co.uk> (message from Richard Dawe on Sat, 08 Mar 2003 00:27:24 +0000) Subject: Re: New POSIX: pwrite [PATCH] References: <200303071845 DOT h27Ij5d18334 AT envy DOT delorie DOT com> <3E6938EC DOT D9BFE2E4 AT phekda DOT freeserve DOT co DOT uk> Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > But is there any easy way we can distinguish between pipes and (regular files, > character devices)? With stdin, stdout, stderr we can assume they are pipes, > if they are not TTYs. But we can't assume that for other file descriptors - we > can use fd_props, if available, to find out. Hence the code only checks stdout > & stderr using isatty(). DOS only has two types of file things: devices and disk files. We don't need the seek fix on devices. > BTW stdaux and stdprn are not TTYs according to isatty(). Is this a bug? 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.