[libc-commits] [libc] [libc] Implement fcntl() function (PR #89507)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Fri Apr 26 15:06:09 PDT 2024


================
@@ -0,0 +1,107 @@
+//===-- Implementation of fcntl -------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/fcntl/fcntl.h"
+
+#include "hdr/fcntl_macros.h"
+#include "hdr/types/struct_flock.h"
+#include "hdr/types/struct_flock64.h"
+#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
+#include "src/__support/common.h"
+#include "src/errno/libc_errno.h"
+
+#include <stdarg.h>
+#include <sys/syscall.h> // For syscall numbers.
+
+// To avoid conflict with system headers when building
+// in overlay mode.
+namespace helper {
+enum pid_type {
+  F_OWNER_TID = 0,
+  F_OWNER_PID,
+  F_OWNER_PGRP,
+};
+struct fowner_ex {
----------------
michaelrj-google wrote:

can you add a comment explaining where this is normally defined? I don't see any documentation on it in posix.

https://github.com/llvm/llvm-project/pull/89507


More information about the libc-commits mailing list