Opened 16 years ago
Last modified 11 years ago
#210 reopened defect
fcntl()
Reported by: | Silvan Scherrer | Owned by: | bird |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | libc-backend | Version: | |
Severity: | normal | Keywords: | |
Cc: |
Description
setting the O_NonBlock flag seems to work, but clearing the flag seems not to work. we found this problem in samba. as samba after clearing the flag still produced EAGAIN. now we changed the fcntl() with os2_ioctl() and the flags are set properly.
Change History (11)
comment:1 by , 14 years ago
Component: | baselayout → libc-backend |
---|---|
Milestone: | → libc-0.6.4 |
comment:2 by , 14 years ago
comment:4 by , 14 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Not able to reproduce the behavior with the testcase using either method: source:trunk/libc/tests/libc/smoketests/nonblock-1.c
comment:5 by , 14 years ago
I've verified the correctness of the testcase on mac os x. So, it's either some more complicated thing or a bug in the samba port.
comment:6 by , 14 years ago
I had to add similar code to exim, courier-imap and tcl to get sockets working correctly.
comment:7 by , 14 years ago
i guess it's more complicated, as also in samba it did not happen every time. and usually it happened after some hours/days of samba running.
comment:8 by , 13 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
i just found another evidence, that fcntl() is not clearing the O_NONBLOCK right. in samba the socket flags where retrieved with fcntl(), set to nonblocking and later is restored the saved flags with fcntl(). now when the client wanted to send some stuff larger than around 33kb we got a WOULDBLOCK back and not all bytes where sent with writev(). after setting the socket with ioctl() to nonblocking all worked as it should. so i guess with small chunks of date it always works, but with larger the problem can be seen. at least in samba we could reproduce the same behaviour on different installations.
comment:9 by , 13 years ago
Milestone: | libc-0.6.4 → libc-0.6.5 |
---|
comment:10 by , 13 years ago
http://svn.netlabs.org/samba/changeset/668 fixed the problem found in comment:8
comment:11 by , 11 years ago
Milestone: | libc-0.6.6 |
---|
it seems that os/2 ioctl FIONBIO reversed data parameter, e.g. data==0 set non-blocking status.