[libc-commits] [libc] [libc] Change fcntl cmd when only fcntl64 is available (PR #99675)

via libc-commits libc-commits at lists.llvm.org
Sat Jul 20 07:15:03 PDT 2024


================
@@ -86,17 +86,37 @@ int fcntl(int fd, int cmd, void *arg) {
     libc_errno = -ret;
     return -1;
   }
+  case F_GETLK: {
+#if defined(SYS_fcntl64)
+    if constexpr (FCNTL_SYSCALL_ID == SYS_fcntl64)
+      return fcntl(fd, F_GETLK64, arg);
+#endif
+    break;
+  }
+  case F_SETLK: {
+#if defined(SYS_fcntl64)
+    if constexpr (FCNTL_SYSCALL_ID == SYS_fcntl64)
+      return fcntl(fd, F_SETLK64, arg);
+#endif
+    break;
+  }
+  case F_SETLKW: {
----------------
lntue wrote:

why don't we wrap all these 3 cases inside `#ifdef SYS_fcntl64` for now?

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


More information about the libc-commits mailing list