delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/03/08/12:03:40

Date: Sat, 8 Mar 2003 12:03:34 -0500
Message-Id: <200303081703.h28H3Yl05143@envy.delorie.com>
X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT delorie DOT com using -f
From: DJ Delorie <dj AT delorie DOT com>
To: eliz AT elta DOT co DOT il
CC: djgpp-workers AT delorie DOT com
In-reply-to: <8361-Sat08Mar2003114656+0200-eliz@elta.co.il>
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> <200303080130 DOT h281UMb24534 AT envy DOT delorie DOT com> <8361-Sat08Mar2003114656+0200-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

> I think there are bits there that tell this.  These are those two
> bits which `isatty' currently uses.
> 
> Why do you think these bits are not enough?

The two bits are defined as "is stdin" and "is stdout".  At the very
least, we should be checking for *either* of those bits, not *both* of
them.

And there are no bits for the AUX device, which should be considered a
terminal.

> Even if we couldn't find a single program where the distinction
> between clock$ and a real terminal device would matter, I think it
> still could make sense to make that distinction, simply because clock$
> is not a terminal device.

Perhaps.  Do we have any other call that looks at just the "is a
device" bit in that dos call?

> > In the case of redirected stdout, for example, we still can't tell the
> > difference between anything other than devices (stdout$, clock$, com1,
> > null, etc) and files
> 
> Unless I misunderstand what you are saying, I think we _can_ tell the
> difference: DOS knows the difference, and `isatty' and `stat'/`fstat'
> tell us about it.

Here's Ralf's list for those bits.  If a device doesn't fit into one
of the four that have their own bits, we can't tell.  There is no
generic "is a console-type device" bit.

 character device
  14	device driver can process IOCTL requests (see AX=4402h"DOS 2+")
  13	output until busy supported
  11	driver supports OPEN/CLOSE calls
   8	??? (set by MS-DOS 6.2x KEYB)
   7	set (indicates device)
   6	EOF on input
   5	raw (binary) mode
   4	device is special (uses INT 29)
   3	clock device
   2	NUL device
   1	standard output
   0	standard input

- Raw text -


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