From: Sangeetha Elumalai <sangeetha.elumalai@timesys.com>
Date: Tue, 20 Jan 2026 11:00:33 +0530

diff --git a/src/basic/chattr-util.h b/src/basic/chattr-util.h
index 1fe38e3..6933e67 100644
--- a/src/basic/chattr-util.h
+++ b/src/basic/chattr-util.h
@@ -8,6 +8,37 @@
 
 #include "missing_fs.h"
 
+#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 37))
+#undef MS_RDONLY
+#undef MS_NOSUID
+#undef MS_NODEV
+#undef MS_NOEXEC
+#undef MS_SYNCHRONOUS
+#undef MS_SHARED
+#undef MS_REMOUNT
+#undef MS_MANDLOCK
+#undef MS_DIRSYNC
+#undef MS_NOSYMFOLLOW
+#undef MS_NOATIME
+#undef MS_NODIRATIME
+#undef MS_BIND
+#undef MS_MOVE
+#undef MS_REC
+#undef MS_SILENT
+#undef MS_POSIXACL
+#undef MS_UNBINDABLE
+#undef MS_PRIVATE
+#undef MS_SLAVE
+#undef MS_RELATIME
+#undef MS_KERNMOUNT
+#undef MS_I_VERSION
+#undef MS_STRICTATIME
+#undef MS_LAZYTIME
+#undef MS_ACTIVE
+#undef MS_NOUSER
+#endif
+
+
 /* The chattr() flags to apply when creating a new file *before* writing to it. In particular, flags such as
  * FS_NOCOW_FL don't work if applied a-posteriori. All other flags are fine (or even necessary, think
  * FS_IMMUTABLE_FL!) to apply after writing to the files. */
diff --git a/src/core/exec-invoke.c b/src/core/exec-invoke.c
index b017918..02d0569 100644
--- a/src/core/exec-invoke.c
+++ b/src/core/exec-invoke.c
@@ -3,7 +3,6 @@
 #include <linux/sched.h>
 #include <sys/eventfd.h>
 #include <sys/ioctl.h>
-#include <sys/mount.h>
 #include <sys/prctl.h>
 
 #if HAVE_PAM
@@ -64,6 +63,8 @@
 #include "utmp-wtmp.h"
 #include "vpick.h"
 
+#include <sys/mount.h>
+
 #define IDLE_TIMEOUT_USEC (5*USEC_PER_SEC)
 #define IDLE_TIMEOUT2_USEC (1*USEC_PER_SEC)
 
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 1029e63..6df17b4 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -10,7 +10,6 @@
 #include <stdlib.h>
 #include <sys/file.h>
 #include <sys/ioctl.h>
-#include <sys/mount.h>
 #include <sys/personality.h>
 #include <sys/prctl.h>
 #include <sys/types.h>
@@ -111,6 +110,8 @@
 #include "user-util.h"
 #include "vpick.h"
 
+#include <sys/mount.h>
+
 /* The notify socket inside the container it can use to talk to nspawn using the sd_notify(3) protocol */
 #define NSPAWN_NOTIFY_SOCKET_PATH "/run/host/notify"
 #define NSPAWN_MOUNT_TUNNEL "/run/host/incoming"
diff --git a/src/repart/repart.c b/src/repart/repart.c
index 4be376e..532cb21 100644
--- a/src/repart/repart.c
+++ b/src/repart/repart.c
@@ -80,6 +80,8 @@
 #include "user-util.h"
 #include "utf8.h"
 
+#include <sys/mount.h>
+
 /* If not configured otherwise use a minimal partition size of 10M */
 #define DEFAULT_MIN_SIZE (10ULL*1024ULL*1024ULL)
 
-- 
2.25.1

