Author: Dharanendiran <dharanendiran@timesys.com>
Date: Thu, 8 Oct 2026 15:37:42 +0530


---
 disk-utils/mkswap.c     |  4 ++++
 lib/netlink.c           |  4 ++++
 libmount/src/monitor.c  | 13 +++++++++++++
 lsfd-cmd/unkn.c         | 16 ++++++++++++++++
 sys-utils/hwclock-rtc.c |  2 +-
 sys-utils/irqtop.c      | 10 +++++++++-
 sys-utils/rfkill.c      |  6 ++++++
 7 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c
index a8ac26a..9a31fd1 100644
--- a/disk-utils/mkswap.c
+++ b/disk-utils/mkswap.c
@@ -80,6 +80,10 @@ enum ENDIANNESS {
 	ENDIANNESS_BIG,
 };
 
+#ifndef FIEMAP_EXTENT_SHARED
+#define FIEMAP_EXTENT_SHARED	0x00002000
+#endif
+
 struct mkswap_control {
 	struct swap_header_v1_2	*hdr;		/* swap header */
 	void			*signature_page;/* buffer with swap header */
diff --git a/lib/netlink.c b/lib/netlink.c
index 28eb185..21beb59 100644
--- a/lib/netlink.c
+++ b/lib/netlink.c
@@ -21,6 +21,10 @@
 #include "debug.h"
 #include "nls.h"
 
+#ifndef IFA_FLAGS
+#define IFA_FLAGS 8
+#endif
+
 /*
  * Debug stuff (based on include/debug.h)
  */
diff --git a/libmount/src/monitor.c b/libmount/src/monitor.c
index 477fbab..15aa543 100644
--- a/libmount/src/monitor.c
+++ b/libmount/src/monitor.c
@@ -171,6 +171,19 @@ struct monitor_entry *monitor_get_entry(struct libmnt_monitor *mn, int type, int
 	return NULL;
 }
 
+#ifndef IN_NONBLOCK
+#define IN_NONBLOCK O_NONBLOCK
+#endif
+
+#ifndef IN_CLOEXEC
+#define IN_CLOEXEC O_CLOEXEC
+#endif
+
+#ifndef __NR_epoll_create1
+#define EPOLL_CLOEXEC 1
+#define epoll_create1 epoll_create
+#endif
+
 
 /*
  * Add/Remove monitor entry to/from monitor epoll.
diff --git a/lsfd-cmd/unkn.c b/lsfd-cmd/unkn.c
index 3bac2fe..efcc072 100644
--- a/lsfd-cmd/unkn.c
+++ b/lsfd-cmd/unkn.c
@@ -30,6 +30,22 @@
 #include "lsfd.h"
 #include "pidfd.h"
 
+#ifndef CLOCK_BOOTTIME
+#define CLOCK_BOOTTIME 7
+#endif
+
+#ifndef CLOCK_REALTIME_ALARM
+#define CLOCK_REALTIME_ALARM 8
+#endif
+
+#ifndef CLOCK_BOOTTIME_ALARM
+#define CLOCK_BOOTTIME_ALARM 9
+#endif
+
+#ifndef SOCK_DCCP
+#define SOCK_DCCP 6
+#endif
+
 #define offsetofend(TYPE, MEMBER)				\
 	(offsetof(TYPE, MEMBER)	+ sizeof_member(TYPE, MEMBER))
 
diff --git a/sys-utils/hwclock-rtc.c b/sys-utils/hwclock-rtc.c
index a210eac..d914cfa 100644
--- a/sys-utils/hwclock-rtc.c
+++ b/sys-utils/hwclock-rtc.c
@@ -13,8 +13,8 @@
 #include <hurd/rtc.h>
 #else
 #include <asm/ioctl.h>
+#include <asm/types.h>
 #include <linux/rtc.h>
-#include <linux/types.h>
 #endif /* __GNU__ */
 #include <errno.h>
 #include <fcntl.h>
diff --git a/sys-utils/irqtop.c b/sys-utils/irqtop.c
index c017053..48caf69 100644
--- a/sys-utils/irqtop.c
+++ b/sys-utils/irqtop.c
@@ -66,6 +66,14 @@ enum irqtop_cpustat_mode {
 	IRQTOP_CPUSTAT_DISABLE,
 };
 
+#include <sys/syscall.h>
+#ifndef __NR_epoll_create1
+#define EPOLL_CREATE_FLAGS 1
+#define epoll_create1 epoll_create
+#else
+#define EPOLL_CREATE_FLAGS 0
+#endif
+
 /* top control struct */
 struct irqtop_ctl {
 	WINDOW	*win;
@@ -233,7 +241,7 @@ static int event_loop(struct irqtop_ctl *ctl, struct irq_output *out)
 	uint64_t unused;
 	int retval = 0;
 
-	efd = epoll_create1(0);
+	efd = epoll_create1(EPOLL_CREATE_FLAGS);
 
 	if ((tfd = timerfd_create(CLOCK_MONOTONIC, 0)) < 0)
 		err(EXIT_FAILURE, _("cannot create timerfd"));
diff --git a/sys-utils/rfkill.c b/sys-utils/rfkill.c
index 88a8a9d..3605c6c 100644
--- a/sys-utils/rfkill.c
+++ b/sys-utils/rfkill.c
@@ -41,6 +41,12 @@
 #include "xalloc.h"
 #include "all-io.h"
 
+#ifndef RFKILL_TYPE_GPS
+# define RFKILL_TYPE_GPS	(RFKILL_TYPE_WWAN + 1)
+#endif
+#ifndef RFKILL_EVENT_SIZE_V1
+# define RFKILL_EVENT_SIZE_V1	8
+#endif
 
 /*
  * NFC supported by kernel since v3.10 (year 2013); FM and another types are from
-- 
2.34.1

