[libc-commits] [libc] [libc][POSIX][poll.h] implement poll (PR #125118)
via libc-commits
libc-commits at lists.llvm.org
Thu Jan 30 13:27:46 PST 2025
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 953354c7afcc375e441e0e3ab4099de1b992d954 035836d3a78bd596ef093a76591bae322ca4f112 --extensions cpp,h -- libc/hdr/types/nfds_t.h libc/hdr/types/struct_pollfd.h libc/include/llvm-libc-macros/linux/poll-macros.h libc/include/llvm-libc-macros/poll-macros.h libc/include/llvm-libc-types/nfds_t.h libc/include/llvm-libc-types/struct_pollfd.h libc/src/poll/linux/poll.cpp libc/src/poll/poll.h libc/test/src/poll/poll_test.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libc/include/llvm-libc-macros/linux/poll-macros.h b/libc/include/llvm-libc-macros/linux/poll-macros.h
index 6c6d026728..d6724c5ee3 100644
--- a/libc/include/llvm-libc-macros/linux/poll-macros.h
+++ b/libc/include/llvm-libc-macros/linux/poll-macros.h
@@ -11,55 +11,55 @@
// From asm-generic/poll.h, redefined here to avoid redeclaring struct pollfd.
#ifndef POLLIN
-#define POLLIN 0x0001
+#define POLLIN 0x0001
#endif
#ifndef POLLPRI
-#define POLLPRI 0x0002
+#define POLLPRI 0x0002
#endif
#ifndef POLLOUT
-#define POLLOUT 0x0004
+#define POLLOUT 0x0004
#endif
#ifndef POLLERR
-#define POLLERR 0x0008
+#define POLLERR 0x0008
#endif
#ifndef POLLHUP
-#define POLLHUP 0x0010
+#define POLLHUP 0x0010
#endif
#ifndef POLLNVAL
-#define POLLNVAL 0x0020
+#define POLLNVAL 0x0020
#endif
#ifndef POLLRDNORM
-#define POLLRDNORM 0x0040
+#define POLLRDNORM 0x0040
#endif
#ifndef POLLRDBAND
-#define POLLRDBAND 0x0080
+#define POLLRDBAND 0x0080
#endif
#ifndef POLLWRNORM
-#define POLLWRNORM 0x0100
+#define POLLWRNORM 0x0100
#endif
#ifndef POLLWRBAND
-#define POLLWRBAND 0x0200
+#define POLLWRBAND 0x0200
#endif
#ifndef POLLMSG
-#define POLLMSG 0x0400
+#define POLLMSG 0x0400
#endif
#ifndef POLLREMOVE
-#define POLLREMOVE 0x1000
+#define POLLREMOVE 0x1000
#endif
#ifndef POLLRDHUP
-#define POLLRDHUP 0x2000
+#define POLLRDHUP 0x2000
#endif
#endif // LLVM_LIBC_MACROS_LINUX_POLL_MACROS_H
diff --git a/libc/src/poll/linux/poll.cpp b/libc/src/poll/linux/poll.cpp
index 4e3ec6de6d..2a3a13b387 100644
--- a/libc/src/poll/linux/poll.cpp
+++ b/libc/src/poll/linux/poll.cpp
@@ -19,7 +19,7 @@
namespace LIBC_NAMESPACE_DECL {
-LLVM_LIBC_FUNCTION(int, poll, (struct pollfd *fds, nfds_t nfds, int timeout)) {
+LLVM_LIBC_FUNCTION(int, poll, (struct pollfd * fds, nfds_t nfds, int timeout)) {
int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_poll, fds, nfds, timeout);
if (ret < 0) {
libc_errno = -ret;
``````````
</details>
https://github.com/llvm/llvm-project/pull/125118
More information about the libc-commits
mailing list