This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
At 02:54 PM 12/5/2003 +0100, Corinna Vinschen wrote: >On Dec 5 08:02, Pierre A. Humblet wrote: >> At 12:14 PM 12/5/2003 +0100, Corinna Vinschen wrote: >> >Two questions: >> > > >> >What is the advantage of using a finite loop with fcntl(F_SETLK) over >> >using fcntl(F_SETLKW) just once? This seems potentially less secure >> >than F_SETLKW and also less secure than the former Mutex solution. >> >> The only reason is that F_SETLKW doesn't work on 9X so you need >> a loop there anyway. But thinking more about it, we should have both >> F_SETLKW and a loop. On NT the loop will never kick in. On 9x F_SETLKW >> works like F_SETLK and the loop is useful. The loop could also be made >> much longer. > >I agree. Are you going to change your patch accordingly? Sure, here it is. BTW, F_SETLKW is yucky, at least on NT4. Not only the fcntl call isn't interruptible but the process itself can't be killed with kill -9 while waiting. The sig thread itself waits during the close() call in the exit sequence. Also a thread can deadlock by locking overlapping file segments. This is FYI, it doesn't matter greatly here. Pierre 2003-12-06 Pierre Humblet <pierre.humblet@ieee.org> * syscalls.cc (locked_append): New. (updwtmp): Remove mutex code and call locked_append. (pututline): Ditto.
Attachment:
syscalls.cc.diff
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |