Skip to contentSkip to conversation

Add symbols from sys/mount.h for older glibc.

PATCH New Vinson Lee 1 participant 1 message Aug 24, 2013

lore
Share & tools
lore

Vinson Lee

author
#0 lore raw

PATCH 1/1 Add symbols from sys/mount.h for older glibc.

From: Vinson Lee <[email protected]>

MNT_DETACH and MNT_EXPIRE are not available with glibc before 2.10.

UMOUNT_NOFOLLOW is not available with glibc before 2.12.

This patches fixes these build errors with older glibc.

syscalls/umount.c:16: error: ‘MNT_DETACH’ undeclared here (not in a function) syscalls/umount.c:16: error: ‘MNT_EXPIRE’ undeclared here (not in a function) syscalls/umount.c:16: error: ‘UMOUNT_NOFOLLOW’ undeclared here (not in a function)

---
 include/compat.h  |   13 +++++++++++++
 syscalls/umount.c |    1 +
 2 files changed, 14 insertions(+), 0 deletions(-)
include/compat.h +13 -0
index ae57fcb..bb77e3b 100644
@@ -761,4 +761,17 @@ struct kvm_get_htab_fd {
 #define MRT_DEL_MFC_PROXY	(MRT_BASE+11)
 #endif
 
+/* sys/mount.h */
+#ifndef MNT_DETACH
+#define MNT_DETACH		2
+#endif
+
+#ifndef MNT_EXPIRE
+#define MNT_EXPIRE		4
+#endif
+
+#ifndef UMOUNT_NOFOLLOW
+#define UMOUNT_NOFOLLOW		8
+#endif
+
 #endif	/* _TRINITY_COMPAT_H */
syscalls/umount.c +1 -0
index 3523df2..fce22ff 100644
@@ -3,6 +3,7 @@
  */
 #include <sys/mount.h>
 #include "sanitise.h"
+#include "compat.h"
 
 struct syscall syscall_umount = {
 	.name = "umount",
Signature · 1 line
1.7.4.1