On Thursday 02 March 2006 1:04 pm, Steve Graegert wrote:
On 3/2/06, Per Jessen
wrote: OK, for the benefit of others listening in, this is what I've briefly described to Steve and Anders on suse-linux-e - who both said "it's impossible" - which I agree with. Reality however seems to be of a different opinion.
did not have time to take a closer look at your code, but I think that fputs(3) itself is not the culprit since it does not necessarily set errno when EOF is encountered (write(2) on the other hand, which is called on behalf of fputs(2), does).
I agree with Steve,
Both fgets(3) and fputs(3) are buffered streams, but you are using
select(2). I would avoid the use of streams even though an C stream is
attached to a valid file descriptor (or socket). I would use either
write(2), read(2), send(2), or recv(2) directly.
--
Jerry Feldman