Gilad Ben-Yossef <[EMAIL PROTECTED]> writes:

> Now, the question is so simple, I suspect I'm being very dumb about
> something, 

Nah...


> Is there some law of the universe (POSIX or otherwise) that
> is supposed to gurantee that when you fdopen file descriptor 1, you'll
> get the stream that equels to the macro (C99/98 says it's a macro)
> stdout?

Purely from memory, it is POSIX, though I would use STDOUT_FILENO
or fileno(stdout). 

Check /usr/include/unistd.h on your system for

/* Standard file descriptors.  */
#define STDIN_FILENO    0       /* Standard input.  */
#define STDOUT_FILENO   1       /* Standard output.  */
#define STDERR_FILENO   2       /* Standard error output.  */

or equivalent.

Can you try the code with STDOUT_FILENO or fileno(stdout) and also
print out some more info, such as errno? 

-- 
Oleg Goldshmidt | [EMAIL PROTECTED]

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to