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

fileno(stdin) versus STDIN_FILENO and friends



On Mar 14, 2011, at 6:56 , Chris Johns wrote:

> I think it is reasonable to make this change. The whole shell and telnet 
> on RTEMS is an application trick to make the RTEMS "process" appear 
> multi-user and process based. We should attempt to make this emulation 
> appear as standard.

I think (but don't know, but would like to know) that we're talking about behavior that isn't defined by a standard. If the behavior is defined, then RTEMS should ensure things follow the standard, but I haven't located a definition yet.

If we're operating outside of any definition then I suggest RTEMS make the stdio thread inheritance behavior optional: I'd prefer an inherited stdin,stdout,stderr, and I'll look at what it takes to make it work in the newlib framework.  Others might like the way it works now, where all threads revert to file descriptors 0, 1, and 2 for stdin, stdout, and stderr for newly created threads.

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