Write failed, errno 0

Posted by EpsilonVector on Stack Overflow See other posts from Stack Overflow or by EpsilonVector
Published on 2010-06-16T22:43:04Z Indexed on 2010/06/16 22:52 UTC
Read the original article Hit count: 165

Filed under:
|
|
|

I have a client server situation in which I receive data using

read(socket, char_buf, BUF_SIZE)

and then try to write it into a log file using

write(filefd, char_buf, strlen(char_buf))

Strangely enough this fails (write returns -1), and yet the errno is set to 0, and I can print the message, AND the log file descriptor works (I write to it before and after this command).

What's going on??

(Working on Linux kernel 2.4 (homework))

© Stack Overflow or respective owner

Related posts about c

    Related posts about homework