Re: [sv-bc] Problem with $ferror in 1364 standard

From: Greg Jaxon <Greg.Jaxon_at_.....>
Date: Mon Mar 20 2006 - 10:08:29 PST
To a 1364-compliant system the value 0 means a multi-channel descriptor having no files opened.
That seems close enough to being a NULL fd, but I thought I'd reprint this 1364 text just to
check that it is not a fatal complication.

> The multi-channel descriptor mcd is a 32-bit reg in which a single bit is set indicating which file is opened.
> The least significant bit (bit 0) of an mcd always refers to the standard output. Output is directed to two or
> more files opened with multi-channel descriptors by bitwise OR-ing together their mcds and writing to the
> resultant value.

> The most significant bit (bit 31) of a multi-channel descriptor is reserved, and shall always be cleared,
> limiting an implementation to at most 31 files opened for output via multi-channel descriptors.

> The file descriptor fd is a 32-bit value. The most significant bit (bit 31) of a fd is reserved, and shall always
> be set; this allows implementations of the file input and output functions to determine how the file was
> opened. The remaining bits hold a small number indicating what file is opened. Three file descriptors are pre
> opened; they are STDIN, STDOUT and STDERR, which have the values 32'h8000_0000,
> 32'h8000_0001 and 32'h8000_0002, respectively. STDIN is pre opened for reading, and STDOUT
> and STDERR are pre opened for append.

> Unlike multi-channel descriptors, file descriptors can not be combined via bitwise-OR in order to direct
> output to multiple files.



Warmke, Doug wrote:
> Yes, I meant 0.
> 
> Regards,
> Doug 
> 
> 
>>-----Original Message-----
>>From: Bresticker, Shalom [mailto:shalom.bresticker@intel.com] 
>>Sent: Sunday, March 19, 2006 10:42 PM
>>To: Warmke, Doug; sv-bc@eda.org
>>Subject: RE: [sv-bc] Problem with $ferror in 1364 standard 
>>
>>By "null fd", do you and Steven mean 0 or something else?
>>
>>Shalom
>>
>>
>>>-----Original Message-----
>>>From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On
>>>Behalf Of Warmke, Doug
>>>Sent: Monday, March 20, 2006 12:31 AM
>>>To: sv-bc@eda.org
>>>Subject: RE: [sv-bc] Problem with $ferror in 1364 standard
>>>
>>>Hello all,
>>>
>>>We also favor interpretation #4.
>>>
>>>A bit more clarification:
>>>We propose that the status of the most recent $fopen,
>>>whether success or failure, shall be returned if a
>>>null fd is passed to $ferror.  That seems most intuitive
>>>and useful.
>>
>>
> 
Received on Mon Mar 20 10:16:06 2006

This archive was generated by hypermail 2.1.8 : Mon Mar 20 2006 - 10:16:28 PST