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 bird, 14 years ago

Component: baselayoutlibc-backend
Milestone: libc-0.6.4

comment:2 by Yuri Dario, 14 years ago

it seems that os/2 ioctl FIONBIO reversed data parameter, e.g. data==0 set non-blocking status.

comment:3 by bird, 14 years ago

(In [3708]) nonblock-1.c: extended the testcase. References #210.

comment:4 by bird, 14 years ago

Resolution: worksforme
Status: newclosed

Not able to reproduce the behavior with the testcase using either method: source:trunk/libc/tests/libc/smoketests/nonblock-1.c

comment:5 by bird, 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 Yuri Dario, 14 years ago

I had to add similar code to exim, courier-imap and tcl to get sockets working correctly.

comment:7 by Silvan Scherrer, 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 Silvan Scherrer, 13 years ago

Resolution: worksforme
Status: closedreopened

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 Silvan Scherrer, 13 years ago

Milestone: libc-0.6.4libc-0.6.5

comment:10 by Silvan Scherrer, 13 years ago

comment:11 by Yuri Dario, 11 years ago

Milestone: libc-0.6.6
Note: See TracTickets for help on using tickets.