fileno(stdin) versus STDIN_FILENO and friends

Peter Dufault dufault at hda.com
Fri Mar 11 20:42:25 UTC 2011


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://lists.rtems.org/pipermail/users/attachments/20110311/d79629b3/attachment-0001.html>


More information about the users mailing list