> On 03 May 2016, at 14:20, Emmanuel Dreyfus <m...@netbsd.org> wrote: > > On Tue, May 03, 2016 at 12:05:01PM +0200, Christoph Badura wrote: >> Didn't I just explain to you that a struct file is never an owner for >> these locks? Didn't others explain that to you too? > > Well, I need you to explain me what happens in sys_flock() then. > Is it a bug? > error = VOP_ADVLOCK(vp, fp, F_UNLCK, &lf, F_FLOCK); > > fp is struct file. Same thing happens in open_setfp() and closef()
The second argument is an identifier, "struct proc *" if the flags (the last argument) contain "F_POSIX" and "struct file *" otherwise. Fcntl(2) uses F_POSIX where flock(2) does not. -- J. Hannken-Illjes - hann...@eis.cs.tu-bs.de - TU Braunschweig (Germany)