Date: Wed, 7 Nov 2001 05:40:02 -0800 (PST) From: Maxim Konovalov <maxim@macomnet.ru> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/23353: fcntl(F_GETLK) return l_pid equal to -1 for the file loked with flock() Message-ID: <200111071340.fA7De2a81528@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/23353; it has been noted by GNATS. From: Maxim Konovalov <maxim@macomnet.ru> To: freebsd-gnats-submit@FreeBSD.org Cc: simon@comsys.ntu-kpi.kiev.ua Subject: Re: kern/23353: fcntl(F_GETLK) return l_pid equal to -1 for the file loked with flock() Date: Wed, 7 Nov 2001 16:30:43 +0300 (MSK) Hello, This behaviour is expected and it is not a bug. From "The Design and Implementation of the 4.4BSD Operating System" by Marshall Kirk McKusick et al, p.210: "The kernel handles the other differing semantics between the two implementations by having the byte-range locks be applied to processes whereas the whole-file locks are applied to descriptors. Because descriptors are shared with child processes, the whole-file locks are inherited. Because the child process gets its own process structure, the byte-fange locks are not inherited" Also take a look at /sys/kern/kern_descrip.c line 366 and line 1425. Flock(2) and fcntl(2) use different structures for lock identification. Imho the PR can be closed. - -maxim -- Maxim Konovalov, MAcomnet, Internet-Intranet Dept., system engineer phone: +7 (095) 796-9079, mailto: maxim@macomnet.ru To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111071340.fA7De2a81528>