[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fileno(stdin) versus STDIN_FILENO and friends



On Mar 11, 2011, at 3:26 , Eric Norum wrote:

> The document at http://pubs.opengroup.org/onlinepubs/009695399/basedefs/unistd.h.html implies that they really are supposed to be constants:
> 
> The following symbolic constants shall be defined for file streams:
> STDERR_FILENO
> File number of stderr; 2.
> STDIN_FILENO
> File number of stdin; 0.
> STDOUT_FILENO
> File number of stdout; 1.
> 
> but I agree that that is rather counterintuitive.
> 
> 

To me that means the streams should either be all shared across all threads or switched such that different threads have different stdin, stdout, stderr but are still files 0, 1, and 2.


Peter
-----------------
Peter Dufault
HD Associates, Inc.      Software and System Engineering

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.rtems.org/pipermail/rtems-users/attachments/20110311/d79629b3/attachment.html>