Re: Possible problem in fcntl

From: Filipe Cabecinhas
Date: Tue Dec 13 2005 - 13:29:23 EST


On 12/13/05, linux-os (Dick Johnson) <linux-os@xxxxxxxxxxxx> wrote:

> So what is it that the socket doesn't do, that you expect it
> should do?
>

When we call recv on that socket, it returns 0 and sets the string to
"" (as if the the client had done an orderly shutdown (which is not
true, since wget says connection refused).

We were expecting it to return -1 and set errno to EAGAIN (or to
return the number of bytes written and set the string to what it
received).

It works as expected if we don't have that (second) fcntl call. But,
as the accept manpage tells us, in linux the socket returned by accept
() does not inherit file status flags such as O_NONBLOCK, so we
think we should call it (to be sure it has that flag). And, even if it
isn't necessary, we can't tell why it's breaking (because it would
just be setting a flag (that is already set )).

Thanks in advance,
Filipe Cabecinhas
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/