NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/59241: POSIX.1-2024: OFD-owned file locks



>Number:         59241
>Category:       kern
>Synopsis:       POSIX.1-2024: OFD-owned file locks
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 31 11:05:00 +0000 2025
>Originator:     Taylor R Campbell
>Release:        current, 10, 9, ...
>Organization:
The NetOFD Posixation
>Environment:
>Description:
NetBSD seems to lack the following:


3.237 OFD-Owned File Lock

A record lock owned by an open file description. OFD-owned file locks are obtained through the use of fcntl() with F_OFD_SETLK or F_OFD_SETLKW. Whenever a file descriptor associated with the owning open file description is inherited these locks remain in effect. OFD-owned file locks are automatically released on the last close of the open file description. These locks are only shared among file descriptors associated with the same open file description. Thus, a multi-threaded process can use multiple open file descriptions (such as by open()) to create independent OFD-owned locks that can then be used to coordinate access patterns to the same file, while multiple file descriptors associated with the same open file description (such as by dup()) share lock actions among all other descriptors associated with the same open file description.

https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html#tag_03_237
>How-To-Repeat:
standards inspection
>Fix:
Yes, please!  (That or write down a reason why we eschew it.)



Home | Main Index | Thread Index | Old Index