Re: fd, streams and stdout

2003-07-10 Thread Oleg Goldshmidt
Oleg Goldshmidt <[EMAIL PROTECTED]> writes: > perror(strerror(errno)); Oleg's software development rule #1187: Never try to make your code cuter [ fprintf(stderr,"%s\n", => perror( ] late at night... Oh, well, no real harm... ;-) -- Oleg Goldshmidt | [EMAIL PROTECTED]

Re: fd, streams and stdout

2003-07-09 Thread Oleg Goldshmidt
Gilad Ben-Yossef <[EMAIL PROTECTED]> writes: > Oleg Goldshmidt wrote: > > > Purely from memory, it is POSIX, though I would use STDOUT_FILENO > > or fileno(stdout). > > OK. I see I wasn't clear about what i was asking. Not to me, but that's my problematic internal parser. Obviously I read the q

Re: fd, streams and stdout

2003-07-09 Thread Gilad Ben-Yossef
Oron Peled wrote: On Wed, 09 Jul 2003 16:43:00 +0300 Gilad Ben-Yossef <[EMAIL PROTECTED]> wrote: How would errno help? the operation isn't failing, it's just doesn't produce stdout. Of course, I'm not sure it guranteed to do that - this was the whole point of my question... ;-) We don't really k

Re: fd, streams and stdout

2003-07-09 Thread Oron Peled
On Wed, 09 Jul 2003 16:43:00 +0300 Gilad Ben-Yossef <[EMAIL PROTECTED]> wrote: > How would errno help? the operation isn't failing, it's just doesn't > produce stdout. Of course, I'm not sure it guranteed to do that - > this was the whole point of my question... ;-) We don't really know if it doe

Re: fd, streams and stdout

2003-07-09 Thread Gilad Ben-Yossef
Gilad Ben-Yossef wrote: Here is the question rephrased: Will I get the exact same stream handle every time I fdopen file dscriptor 1? For example, does the following *guranteed* to work? #include #include int main(void) { printf("stdout: %lx\n", stdout); fclose(stdout);

Re: fd, streams and stdout

2003-07-09 Thread Gilad Ben-Yossef
Oleg Goldshmidt wrote: Can you try the code with STDOUT_FILENO or fileno(stdout) and also print out some more info, such as errno? How would errno help? the operation isn't failing, it's just doesn't produce stdout. Of course, I'm not sure it guranteed to do that - this was the whole point of

Re: fd, streams and stdout

2003-07-09 Thread Beni Cherniavsky
Gilad Ben-Yossef wrote on 2003-07-09: > void pop_stdout() > { > if (Dup_stdout == -1) { > sprintf(ebuf, "ERROR: pop_stdout: push_stdout never called"); > tet_infoline(ebuf); > tet_result(TET_FAIL); > return; > }

Re: fd, streams and stdout

2003-07-09 Thread Gilad Ben-Yossef
Oleg Goldshmidt wrote: Purely from memory, it is POSIX, though I would use STDOUT_FILENO or fileno(stdout). OK. I see I wasn't clear about what i was asking. Here is the question rephrased: Will I get the exact same stream handle every time I fdopen file dscriptor 1? For example, does the fol

Re: fd, streams and stdout

2003-07-09 Thread Oleg Goldshmidt
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 eq

fd, streams and stdout

2003-07-09 Thread Gilad Ben-Yossef
Howdie all, Time for an actual Linux (or at least programming) question :-) Now, the question is so simple, I suspect I'm being very dumb about something, but since I can't figure it out I'll have to take my chances and ask anyways I have this test program (the vsw5 test suite for the X Wi