On Tue, Jul 08, 2008 at 02:47:32PM +0400, Alexey I. Froloff wrote: > * Dmitry V. Levin [080708 03:32]: > > Хотя в таком простом варианте есть race. > В моём варианте кажется тоже есть race... > > As well as being removed by an explicit F_UNLCK, record locks are > automatically released when the process terminates or if it > closes any file descriptor referring to a file on which locks are > held. This is bad: it means that a process can lose the locks on > a file like /etc/passwd or /etc/mtab when for some reason a > library function decides to open, read and close it. > > Или к другим процессам, которые открывают файл, это не относится? Конечно. -- ldv