[libc-commits] [libc] [libc] Implement lockf in unistd (#230856) (PR #231145)
Pavel Labath via libc-commits
libc-commits at lists.llvm.org
Wed Oct 14 00:14:59 PDT 2026
================
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// Linux implementation of lockf.
+///
+//===----------------------------------------------------------------------===//
+
+#include "src/unistd/lockf.h"
+
+#include "hdr/errno_macros.h"
+#include "hdr/fcntl_macros.h"
+#include "hdr/types/off_t.h"
+#include "hdr/types/struct_flock.h"
+#include "hdr/unistd_macros.h"
+#include "src/__support/OSUtil/linux/syscall_wrappers/fcntl.h"
+#include "src/__support/OSUtil/linux/syscall_wrappers/getpid.h"
+#include "src/__support/common.h"
+#include "src/__support/error_or.h"
+#include "src/__support/libc_errno.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace {
----------------
labath wrote:
We're not terribly consistent about this, but the official llvm policy is to use static functions for cases like this (and the libc policy has nothing to override that): https://llvm.org/docs/CodingStandards.html#restrict-visibility
https://github.com/llvm/llvm-project/pull/231145
More information about the libc-commits
mailing list