Author: Dharanendiran <dharanendiran@timesys.com>
Date: Wed, 7 Oct 2026 22:58:10 +0530


---
 include/audit-arch.h         | 12 ++++++++++++
 include/caputils.h           | 12 ++++++++++++
 include/xxhash.h             |  4 ++++
 libmount/src/hook_mount.c    |  4 ++++
 libmount/src/hook_subdir.c   | 14 ++++++++++++++
 libmount/src/mountP.h        |  4 ++++
 lsfd-cmd/lsfd.c              | 31 +++++++++++++++++++++++++++++++
 lsfd-cmd/sock-xinfo.c        | 34 ++++++++++++++++++++++++++++++++++
 misc-utils/pipesz.c          |  8 ++++++++
 sys-utils/fstrim.c           |  3 +++
 sys-utils/hwclock.h          |  8 ++++++++
 sys-utils/setpriv-landlock.c |  4 ++++
 12 files changed, 138 insertions(+)

diff --git a/include/audit-arch.h b/include/audit-arch.h
index 9afc663..a9ae6cf 100644
--- a/include/audit-arch.h
+++ b/include/audit-arch.h
@@ -9,6 +9,18 @@
 #ifndef UTIL_LINUX_AUDIT_ARCH_H
 #define UTIL_LINUX_AUDIT_ARCH_H
 
+#ifndef AUDIT_ARCH_AARCH64
+#define AUDIT_ARCH_AARCH64	(EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#endif
+
+#ifndef EM_ARM
+#define EM_ARM		40
+#endif
+
+#ifndef EM_AARCH64
+#define EM_AARCH64	183	/* ARM 64 bit */
+#endif
+
 #if __x86_64__
 #    define SECCOMP_ARCH_NATIVE AUDIT_ARCH_X86_64
 #elif __i386__
diff --git a/include/caputils.h b/include/caputils.h
index 0a966d9..893bb96 100644
--- a/include/caputils.h
+++ b/include/caputils.h
@@ -25,6 +25,18 @@
 #  define PR_CAP_AMBIENT_LOWER	3
 #endif
 
+#ifndef PR_CAPBSET_READ
+#define PR_CAPBSET_READ 23
+#endif
+
+#ifndef _LINUX_CAPABILITY_VERSION_3
+#define _LINUX_CAPABILITY_VERSION_3  0x20080522
+#endif
+
+#ifndef _LINUX_CAPABILITY_U32S_3
+#define _LINUX_CAPABILITY_U32S_3     2
+#endif
+
 extern int capset(cap_user_header_t header, cap_user_data_t data);
 extern int capget(cap_user_header_t header, const cap_user_data_t data);
 
diff --git a/include/xxhash.h b/include/xxhash.h
index 5a581b8..e2275ba 100644
--- a/include/xxhash.h
+++ b/include/xxhash.h
@@ -1518,6 +1518,10 @@ static void* XXH_memcpy(void* dest, const void* src, size_t size)
 #  define XXH_ASSERT(c)   ((void)0)
 #endif
 
+#ifndef __USE_ISOC11
+# define static_assert _Static_assert
+#endif
+
 /* note: use after variable declarations */
 #ifndef XXH_STATIC_ASSERT
 #  if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)    /* C11 */
diff --git a/libmount/src/hook_mount.c b/libmount/src/hook_mount.c
index 94d3c72..39537d8 100644
--- a/libmount/src/hook_mount.c
+++ b/libmount/src/hook_mount.c
@@ -50,6 +50,10 @@
 #include "mangle.h"
 #include "linux_version.h"
 
+#ifndef AT_NO_AUTOMOUNT
+#define AT_NO_AUTOMOUNT 0x800
+#endif
+
 #ifdef USE_LIBMOUNT_MOUNTFD_SUPPORT
 
 #define get_sysapi(_cxt) mnt_context_get_sysapi(_cxt)
diff --git a/libmount/src/hook_subdir.c b/libmount/src/hook_subdir.c
index f65529f..1d64573 100644
--- a/libmount/src/hook_subdir.c
+++ b/libmount/src/hook_subdir.c
@@ -39,6 +39,20 @@
 #include "fileutils.h"
 #include "linux_version.h"
 
+#if defined(__UCLIBC__) && !HAVE_SETNS
+#include <sys/syscall.h>
+#include <unistd.h>
+static inline int setns(int fd, int nstype)
+{
+#  ifdef __NR_setns
+        return syscall(__NR_setns, fd, nstype);
+#  else
+        errno = ENOSYS;
+        return -1;
+#  endif
+}
+#endif
+
 struct hookset_data {
 	char *subdir;
 	char *org_target;
diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h
index 8c5800a..9ccfebf 100644
--- a/libmount/src/mountP.h
+++ b/libmount/src/mountP.h
@@ -33,6 +33,10 @@
 #include "buffer.h"
 #include "libmount.h"
 
+#ifndef AT_EMPTY_PATH
+#define AT_EMPTY_PATH		0x1000	/* Allow empty relative pathname */
+#endif
+
 #include "mountutils.h"
 
 /*
diff --git a/lsfd-cmd/lsfd.c b/lsfd-cmd/lsfd.c
index 4991ce1..bf2f2fa 100644
--- a/lsfd-cmd/lsfd.c
+++ b/lsfd-cmd/lsfd.c
@@ -59,6 +59,37 @@
 
 #include "lsfd.h"
 
+#if defined(__UCLIBC__) && !HAVE_SETNS
+#include <sys/syscall.h>
+#include <unistd.h>
+static inline int setns(int fd, int nstype)
+{
+#  ifdef __NR_setns
+        return syscall(__NR_setns, fd, nstype);
+#  else
+        errno = ENOSYS;
+        return -1;
+#  endif
+}
+#endif
+
+#ifdef __UCLIBC__
+
+static ssize_t
+strace_process_vm_readv(pid_t pid,
+		 const struct iovec *lvec,
+		 unsigned long liovcnt,
+		 const struct iovec *rvec,
+		 unsigned long riovcnt,
+		 unsigned long flags)
+{
+	return syscall(__NR_process_vm_readv,
+		       (long) pid, lvec, liovcnt, rvec, riovcnt, flags);
+}
+# define process_vm_readv strace_process_vm_readv
+
+#endif
+
 /* Make sure this ifdef block comes after all the includes since
  * c.h is required for the case where the system does not have kcmp.h */
 #ifdef HAVE_LINUX_KCMP_H
diff --git a/lsfd-cmd/sock-xinfo.c b/lsfd-cmd/sock-xinfo.c
index b56b669..c12cd79 100644
--- a/lsfd-cmd/sock-xinfo.c
+++ b/lsfd-cmd/sock-xinfo.c
@@ -50,6 +50,40 @@
 #include "pidfd-utils.h"
 #include "sock.h"
 
+#ifndef IPPROTO_BEETPH
+#define IPPROTO_BEETPH 94
+#endif
+
+#ifndef IPPROTO_MH
+#define IPPROTO_MH 135
+#endif
+
+#ifndef IPPROTO_MPLS
+#define IPPROTO_MPLS 137
+#endif
+
+#ifndef AF_VSOCK
+#define AF_VSOCK 40
+#endif
+
+#ifndef SOCK_DCCP
+#define SOCK_DCCP 6
+#endif
+
+#if defined(__UCLIBC__) && !HAVE_SETNS
+#include <sys/syscall.h>
+#include <unistd.h>
+static inline int setns(int fd, int nstype)
+{
+#  ifdef __NR_setns
+        return syscall(__NR_setns, fd, nstype);
+#  else
+        errno = ENOSYS;
+        return -1;
+#  endif
+}
+#endif
+
 static void load_xinfo_from_proc_icmp(ino_t netns_inode, enum sysfs_byteorder byteorder);
 static void load_xinfo_from_proc_icmp6(ino_t netns_inode, enum sysfs_byteorder byteorder);
 static void load_xinfo_from_proc_unix(ino_t netns_inode);
diff --git a/misc-utils/pipesz.c b/misc-utils/pipesz.c
index 5a2c0d0..62f57eb 100644
--- a/misc-utils/pipesz.c
+++ b/misc-utils/pipesz.c
@@ -41,6 +41,14 @@ static char opt_verbose = 0;	/* --verbose */
 #define PIPESZ_DEFAULT_SIZE_FILE _PATH_PROC_PIPE_MAX_SIZE
 #endif
 
+#ifndef F_SETPIPE_SZ
+# define F_SETPIPE_SZ	1031    /* Set pipe page size array.  */
+#endif
+
+#ifndef F_GETPIPE_SZ
+# define F_GETPIPE_SZ	1032    /* Get pipe page size array.  */
+#endif
+
 /* convenience macros, since pipesz is by default very lenient */
 #define check(FMT...) do {			\
 	if (opt_check) {			\
diff --git a/sys-utils/fstrim.c b/sys-utils/fstrim.c
index 0e31e7e..9b1c784 100644
--- a/sys-utils/fstrim.c
+++ b/sys-utils/fstrim.c
@@ -50,6 +50,9 @@
 
 #include <libmount.h>
 
+#ifndef O_PATH
+#define O_PATH 010000000
+#endif
 
 #ifndef FITRIM
 struct fstrim_range {
diff --git a/sys-utils/hwclock.h b/sys-utils/hwclock.h
index 7073bc3..c5bc526 100644
--- a/sys-utils/hwclock.h
+++ b/sys-utils/hwclock.h
@@ -25,6 +25,14 @@
 #define HWCLOCK_DEBUG_DELTA_VS_TARGET	(1 << 2)
 #define HWCLOCK_DEBUG_ALL		0xFFFF
 
+#ifndef RTC_VL_READ
+#define RTC_VL_READ	_IOR('p', 0x13, unsigned int)	/* Voltage low detection */
+#endif
+
+#ifndef RTC_VL_CLR
+#define RTC_VL_CLR	_IO('p', 0x14)		/* Clear voltage low information */
+#endif
+
 UL_DEBUG_DECLARE_MASK(hwclock);
 #define DBG(m, x)	__UL_DBG(hwclock, HWCLOCK_DEBUG_, m, x)
 #define ON_DBG(m, x)	__UL_DBG_CALL(hwclock, HWCLOCK_DEBUG_, m, x)
diff --git a/sys-utils/setpriv-landlock.c b/sys-utils/setpriv-landlock.c
index 90ab895..ea33cf8 100644
--- a/sys-utils/setpriv-landlock.c
+++ b/sys-utils/setpriv-landlock.c
@@ -20,6 +20,10 @@
 #include "nls.h"
 #include "c.h"
 
+#ifndef O_PATH
+#define O_PATH 010000000
+#endif
+
 #ifndef HAVE_LANDLOCK_CREATE_RULESET
 static inline int landlock_create_ruleset(
 		const struct landlock_ruleset_attr *attr,
-- 
2.25.1

