diff mbox series

[uclibc-ng-devel] epoll.h: Add epoll ioctls

Message ID 20240529072350.9395-1-jdamato@fastly.com
State Accepted
Headers show
Series [uclibc-ng-devel] epoll.h: Add epoll ioctls | expand

Commit Message

Joe Damato May 29, 2024, 7:23 a.m. UTC
add two ioctls to get and set struct epoll_params to allow users to
control epoll based busy polling of network sockets.

added to uapi in commit 18e2bf0edf4dd88d9656ec92395aa47392e85b61 (Linux
kernel 6.9 and newer).

Signed-off-by: Joe Damato <jdamato@fastly.com>
---
 libc/sysdeps/linux/common/sys/epoll.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Waldemar Brodkorb June 1, 2024, 5:22 p.m. UTC | #1
Hi Joe,
Joe Damato wrote,

> add two ioctls to get and set struct epoll_params to allow users to
> control epoll based busy polling of network sockets.
> 
> added to uapi in commit 18e2bf0edf4dd88d9656ec92395aa47392e85b61 (Linux
> kernel 6.9 and newer).
> 
> Signed-off-by: Joe Damato <jdamato@fastly.com>

Thanks, applied and pushed,
 best regards
  Waldemar
diff mbox series

Patch

diff --git a/libc/sysdeps/linux/common/sys/epoll.h b/libc/sysdeps/linux/common/sys/epoll.h
index 5551bed0d..5138d77a9 100644
--- a/libc/sysdeps/linux/common/sys/epoll.h
+++ b/libc/sysdeps/linux/common/sys/epoll.h
@@ -19,6 +19,7 @@ 
 #define	_SYS_EPOLL_H	1
 
 #include <stdint.h>
+#include <sys/ioctl.h>
 #include <sys/types.h>
 
 /* Get __sigset_t.  */
@@ -87,6 +88,19 @@  struct epoll_event
   epoll_data_t data;	/* User data variable */
 } __EPOLL_PACKED;
 
+struct epoll_params
+{
+  uint32_t busy_poll_usecs;
+  uint16_t busy_poll_budget;
+  uint8_t prefer_busy_poll;
+
+  /* pad the struct to a multiple of 64bits */
+  uint8_t __pad;
+};
+
+#define EPOLL_IOC_TYPE 0x8A
+#define EPIOCSPARAMS _IOW(EPOLL_IOC_TYPE, 0x01, struct epoll_params)
+#define EPIOCGPARAMS _IOR(EPOLL_IOC_TYPE, 0x02, struct epoll_params)
 
 __BEGIN_DECLS