I am experiencing a difference in behavior in nsunix between Red Hat 6.1
(kernel 2.2.14) and Red Hat 7.1. I don't have 7.1 to develop on, this is
basically, a user report....
In 6.1, when I call recvfrom within nsunix.c/GetDATAFromUDS, it returns 0,
as in 0 bytes were available.
The exact same call from 7.1 returns a -1, and an errno of EWOULDBLOCK.
struct sockaddr_in sa;
int size;
size = sizeof(sa);
. . .
nbytes = recvfrom(sock,NULL,0,MSG_PEEK,&sa,&size);
In both cases, the underlying socket has been tagged as nonblocking, and in
fact, I can basically expect that there is nothing to read from the socket
for most GETs. That's okay. As you can see, the call to recvfrom asks for
0 bytes, and is called for its side effect: to fill out the sockaddr_in
structure which yields the IP address of the client browser.
I can understand the 6.1 behavior of recvfrom: I was asked for 0 bytes, and
0 bytes were available, so return 0 bytes. I can rationalize the 7.1
behavior. There are no bytes in the buffer, so I will have to issue a read
to read any bytes that I have to return. Since I am nonblocking, return -1
and an errno of EWOULDBLOCK.
So my question is: does anyone actually know what's going on? Is there a
kernel bug here in either 6.1 or 7.1? Should a nonblocking call be able to
return 0 bytes?
Does anyone have a 7.1 system I could use for a couple of hours to develop
and test this on?
Thanks,
Jerry Asher
=====================================================
Jerry Asher [EMAIL PROTECTED]
1678 Shattuck Avenue Suite 161 Tel: (510) 549-2980
Berkeley, CA 94709 Fax: (877) 311-8688