From: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
To: "Willy Tarreau" <w@1wt.eu>, "Thomas Weißschuh" <linux@weissschuh.net>
Cc: linux-kernel@vger.kernel.org,
"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Subject: [PATCH 2/2] tools/nolibc: use poll-related definitions from UAPI headers
Date: Wed, 30 Apr 2025 11:35:33 +0200 [thread overview]
Message-ID: <20250430-poll-v1-2-44b5ceabdeee@linutronix.de> (raw)
In-Reply-To: <20250430-poll-v1-0-44b5ceabdeee@linutronix.de>
The UAPI headers already provide definitions for these symbols.
Using them makes the code shorter, more robust and compatible with
applications using linux/poll.h directly.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
tools/include/nolibc/poll.h | 2 +-
tools/include/nolibc/types.h | 14 --------------
2 files changed, 1 insertion(+), 15 deletions(-)
diff --git a/tools/include/nolibc/poll.h b/tools/include/nolibc/poll.h
index be6e44fe022d9e8f196821c6c5eb6d0a56e8aacb..1765acb17ea01ff53cbad0b4750e4938446b6a45 100644
--- a/tools/include/nolibc/poll.h
+++ b/tools/include/nolibc/poll.h
@@ -11,9 +11,9 @@
#define _NOLIBC_POLL_H
#include "arch.h"
-#include "types.h"
#include "sys.h"
+#include <linux/poll.h>
#include <linux/time.h>
/*
diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h
index fe97953d16572db3e4c18cdc8921c6a991d64f94..70f20519ebf908b90c242b5ff71d05364fa89f2f 100644
--- a/tools/include/nolibc/types.h
+++ b/tools/include/nolibc/types.h
@@ -159,20 +159,6 @@ typedef struct {
__set->fds[__idx] = 0; \
} while (0)
-/* for poll() */
-#define POLLIN 0x0001
-#define POLLPRI 0x0002
-#define POLLOUT 0x0004
-#define POLLERR 0x0008
-#define POLLHUP 0x0010
-#define POLLNVAL 0x0020
-
-struct pollfd {
- int fd;
- short int events;
- short int revents;
-};
-
/* for getdents64() */
struct linux_dirent64 {
uint64_t d_ino;
--
2.49.0
next prev parent reply other threads:[~2025-04-30 9:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 9:35 [PATCH 0/2] tools/nolibc: introduce poll.h Thomas Weißschuh
2025-04-30 9:35 ` [PATCH 1/2] tools/nolibc: move poll() to poll.h Thomas Weißschuh
2025-04-30 9:35 ` Thomas Weißschuh [this message]
2025-05-11 18:43 ` [PATCH 0/2] tools/nolibc: introduce poll.h Willy Tarreau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250430-poll-v1-2-44b5ceabdeee@linutronix.de \
--to=thomas.weissschuh@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=w@1wt.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®