[libc-commits] [libc] [libc] Implement fcntl when only SYS_fcntl64 is available (PR #97740)

via libc-commits libc-commits at lists.llvm.org
Thu Jul 4 08:29:49 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff c20695a44817d52abda3dee495ef2a172ca315fa 971204332316ebb3549268e6bcb2793825733846 -- libc/src/__support/OSUtil/linux/fcntl.cpp libc/test/src/sys/mman/linux/shm_test.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/src/__support/OSUtil/linux/fcntl.cpp b/libc/src/__support/OSUtil/linux/fcntl.cpp
index 2336d6993b..a689d21286 100644
--- a/libc/src/__support/OSUtil/linux/fcntl.cpp
+++ b/libc/src/__support/OSUtil/linux/fcntl.cpp
@@ -54,7 +54,8 @@ int fcntl(int fd, int cmd, void *arg) {
     flk64.l_len = flk->l_len;
     flk64.l_pid = flk->l_pid;
     // create a syscall
-    int retVal = LIBC_NAMESPACE::syscall_impl<int>(FCNTL_SYSCALL_ID, fd, cmd, &flk64);
+    int retVal =
+        LIBC_NAMESPACE::syscall_impl<int>(FCNTL_SYSCALL_ID, fd, cmd, &flk64);
     // On failure, return
     if (retVal == -1)
       return -1;
@@ -75,8 +76,8 @@ int fcntl(int fd, int cmd, void *arg) {
   }
   case F_GETOWN: {
     struct f_owner_ex fex;
-    int ret =
-        LIBC_NAMESPACE::syscall_impl<int>(FCNTL_SYSCALL_ID, fd, F_GETOWN_EX, &fex);
+    int ret = LIBC_NAMESPACE::syscall_impl<int>(FCNTL_SYSCALL_ID, fd,
+                                                F_GETOWN_EX, &fex);
     if (ret >= 0)
       return fex.type == F_OWNER_PGRP ? -fex.pid : fex.pid;
     libc_errno = -ret;

``````````

</details>


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


More information about the libc-commits mailing list