summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/sysdeps/linux/common/umount.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/common/umount.c b/libc/sysdeps/linux/common/umount.c
index 6457ddf30..f4eb8c64e 100644
--- a/libc/sysdeps/linux/common/umount.c
+++ b/libc/sysdeps/linux/common/umount.c
@@ -12,6 +12,13 @@
#ifdef __NR_umount /* Some newer archs only have umount2 */
#include <sys/mount.h>
_syscall1(int, umount, const char *, specialfile);
+#elif defined __NR_umount2
+/* No umount syscall, but umount2 is available.... Try to
+ * emulate umount() using umount2() */
+int umount(const char *special_file, int flags)
+{
+ return _syscall2(int, umount2, const char *, special_file, int, flags);
+}
#else
int umount(const char *special_file)
{