[libc-commits] [libc] [libc] pipe(2) linux syscall impl. draft (PR #85402)

via libc-commits libc-commits at lists.llvm.org
Fri Mar 15 07:11:10 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 61fadd0b09fb012b628b050725d348ad2164f328 049c0c67ef9d2fafb7499a6e7b4ca0245943b1d8 -- libc/src/unistd/linux/pipe2.cpp libc/src/unistd/pipe2.h libc/test/src/unistd/pipe2_test.cpp
``````````

</details>

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

``````````diff
diff --git a/libc/src/unistd/linux/pipe2.cpp b/libc/src/unistd/linux/pipe2.cpp
index 9f2e539010..52997e3ca1 100644
--- a/libc/src/unistd/linux/pipe2.cpp
+++ b/libc/src/unistd/linux/pipe2.cpp
@@ -1,4 +1,5 @@
-//===-- Linux implementation of pipe2 ---------------------------------------===//
+//===-- Linux implementation of pipe2
+//---------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -17,12 +18,12 @@
 namespace LIBC_NAMESPACE {
 
 LLVM_LIBC_FUNCTION(int, pipe2, (int pipefd[2], int flags)) {
-    int ret;
+  int ret;
 #ifdef SYS_pipe2
   ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_pipe2, pipefd, flags);
-#elif defined (SYS_pipe)
+#elif defined(SYS_pipe)
   ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_pipe, pipefd);
-#else 
+#else
 #error "pipe and pipe2 not available."
 #endif
   if (ret == -1) {
diff --git a/libc/src/unistd/pipe2.h b/libc/src/unistd/pipe2.h
index 3cf5d81f1f..06a55857a5 100644
--- a/libc/src/unistd/pipe2.h
+++ b/libc/src/unistd/pipe2.h
@@ -1,4 +1,5 @@
-//===-- Implementation header for pipe2 ---------------------------*- C++ -*-===//
+//===-- Implementation header for pipe2 ---------------------------*- C++
+//-*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/libc/test/src/unistd/pipe2_test.cpp b/libc/test/src/unistd/pipe2_test.cpp
index da6607fe68..8eb0fcf897 100644
--- a/libc/test/src/unistd/pipe2_test.cpp
+++ b/libc/test/src/unistd/pipe2_test.cpp
@@ -1,4 +1,5 @@
-//===-- Unittests for pipe2 -------------------------------------------------===//
+//===-- Unittests for pipe2
+//-------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.

``````````

</details>


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


More information about the libc-commits mailing list