NetBSD Problem Report #59241
From www@netbsd.org Mon Mar 31 11:04:46 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits)
client-signature RSA-PSS (2048 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 2E4BE1A9239
for <gnats-bugs@gnats.NetBSD.org>; Mon, 31 Mar 2025 11:04:46 +0000 (UTC)
Message-Id: <20250331110445.1F82C1A923E@mollari.NetBSD.org>
Date: Mon, 31 Mar 2025 11:04:45 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: POSIX.1-2024: OFD-owned file locks
X-Send-Pr-Version: www-1.0
>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.)
(Contact us)
$NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.