Re: F_DUPFD_CLOEXEC implementation

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Denys Vlasenko <vda.linux@...>
Cc: Ulrich Drepper <drepper@...>, <linux-kernel@...>, <akpm@...>
Date: Sunday, September 30, 2007 - 7:11 pm

On Sun, 30 Sep 2007, Denys Vlasenko wrote:


I'm not sure I understood correctly your use case. But, if you have two 
processes/threads randomly switching O_NONBLOCK on/off, your problems 
arise not only the F_SETFL time.
If one of the tasks is not expecting an fd to be O_NONBLOCK, that will 
likely end up not handling correctly read/write-miss situations.
In that case it'd be better to keep the fd as O_NONBLOCK, and manually 
create blocking behaviour (when needed) with poll+read/write.



- Davide


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
F_DUPFD_CLOEXEC implementation, Ulrich Drepper, (Fri Sep 28, 1:34 pm)
Re: F_DUPFD_CLOEXEC implementation, Denys Vlasenko, (Sat Sep 29, 8:31 pm)
Re: F_DUPFD_CLOEXEC implementation, Miquel van Smoorenburg, (Sun Sep 30, 8:59 pm)
Re: F_DUPFD_CLOEXEC implementation, Davide Libenzi, (Sun Sep 30, 7:11 pm)
Re: F_DUPFD_CLOEXEC implementation, Denys Vlasenko, (Sun Sep 30, 7:58 pm)
Re: F_DUPFD_CLOEXEC implementation, Davide Libenzi, (Sun Sep 30, 11:15 pm)
Re: F_DUPFD_CLOEXEC implementation, Denys Vlasenko, (Mon Oct 1, 6:07 am)
Re: F_DUPFD_CLOEXEC implementation, Al Viro, (Mon Oct 1, 2:16 pm)
Re: F_DUPFD_CLOEXEC implementation, Michael Tokarev, (Mon Oct 1, 2:53 pm)
Re: F_DUPFD_CLOEXEC implementation, Denys Vlasenko, (Mon Oct 1, 2:49 pm)
Re: F_DUPFD_CLOEXEC implementation, Davide Libenzi, (Mon Oct 1, 3:04 pm)
Re: F_DUPFD_CLOEXEC implementation, Denys Vlasenko, (Tue Oct 2, 5:28 am)
Re: F_DUPFD_CLOEXEC implementation, Davide Libenzi, (Tue Oct 2, 3:52 pm)
Re: F_DUPFD_CLOEXEC implementation, Davide Libenzi, (Fri Sep 28, 2:19 pm)
Re: F_DUPFD_CLOEXEC implementation, Ulrich Drepper, (Fri Sep 28, 2:23 pm)