Debian patches 0011-Add-new-defines-to-indicate-which-syscall-is-umount-3.diff 0012-Add-an-implementation-of-umount-3-for-ia64.diff . From a35138d49e022dd94fd91974fa2ed2ef6dd58a90 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 3 Jan 2009 12:04:48 +0000 Subject: [PATCH 11/13] Add new #defines to indicate which syscall is umount(3) and which is umount2(3). * on architectures where __NR_umount is umount(3) and __NR_umount2 is umount2(3), don't do anything special * on architectures where this is not the case, define __NR_umount_with_flags so that it's umount2(3) * define __NR_umount_without_flags to be umount(3) on architectures where such a syscall exists In the currently-supported architectures there are four families: * on i386, arm etc., __NR_umount takes one argument and __NR_umount2 takes two * on x86_64 and parisc __NR_umount2 takes two arguments and there is no 1-argument umount * on alpha, __NR_oldumount takes one argument and __NR_umount takes two * on ia64, __NR_umount takes two arguments and there is no 1-argument umount --- alpha/syscalls.h | 2 ++ ia64/syscalls.h | 2 ++ syscalls.s/umount.S | 4 ++++ syscalls.s/umount2.S | 4 +++- 4 files changed, 11 insertions(+), 1 deletions(-) diff --git a/alpha/syscalls.h b/alpha/syscalls.h index 1ab37e8..7636b0c 100644 --- a/alpha/syscalls.h +++ b/alpha/syscalls.h @@ -413,6 +413,8 @@ #define __NR_timerfd 477 #define __NR_eventfd 478 +#define __NR_umount_without_flags __NR_oldumount +#define __NR_umount_with_flags __NR_umount #define syscall_weak(name,wsym,sym) \ .text ; \ diff --git a/ia64/syscalls.h b/ia64/syscalls.h index 907cb5c..7e86174 100644 --- a/ia64/syscalls.h +++ b/ia64/syscalls.h @@ -290,6 +290,8 @@ #define __NR_timerfd_settime 1311 #define __NR_timerfd_gettime 1312 +#define __NR_umount_with_flags __NR_umount + #define syscall(name, sym) \ .text; \ .globl sym; \ diff --git a/syscalls.s/umount.S b/syscalls.s/umount.S index 4a423d9..89793e2 100644 --- a/syscalls.s/umount.S +++ b/syscalls.s/umount.S @@ -1,3 +1,7 @@ #include "syscalls.h" +#if defined(__NR_umount_without_flags) +syscall(umount_without_flags,umount) +#elif !defined(__NR_umount_with_flags) || (__NR_umount != __NR_umount_with_flags) syscall(umount,umount) +#endif diff --git a/syscalls.s/umount2.S b/syscalls.s/umount2.S index b27b353..5742416 100644 --- a/syscalls.s/umount2.S +++ b/syscalls.s/umount2.S @@ -1,5 +1,7 @@ #include "syscalls.h" -#ifdef __NR_umount2 +#if defined(__NR_umount_with_flags) +syscall(umount_with_flags,umount2) +#elif defined(__NR_umount2) syscall(umount2,umount2) #endif -- 1.7.0.3 From 4510d9f53bd77bc8b97d37c78b499d85d0a97d4f Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 3 Jan 2009 12:11:42 +0000 Subject: [PATCH 12/13] Add an implementation of umount(3) for ia64 Like x86_64 and parisc, ia64 lacks a single-argument umount syscall, so we need to provide a stub implementation that just calls umount2(path, 0). I don't know ia64 assembler, so this one is in C. --- ia64/Makefile.add | 2 +- ia64/umount-wrapper.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletions(-) create mode 100644 ia64/umount-wrapper.c diff --git a/ia64/Makefile.add b/ia64/Makefile.add index f660930..ca00e4d 100644 --- a/ia64/Makefile.add +++ b/ia64/Makefile.add @@ -1,2 +1,2 @@ VPATH:=ia64:syscalls.s:$(VPATH) -LIBOBJ+=$(OBJDIR)/__time.o $(OBJDIR)/__waitpid.o $(OBJDIR)/__alarm.o $(OBJDIR)/__CAS.o $(OBJDIR)/__pause.o +LIBOBJ+=$(OBJDIR)/__time.o $(OBJDIR)/__waitpid.o $(OBJDIR)/__alarm.o $(OBJDIR)/__CAS.o $(OBJDIR)/__pause.o $(OBJDIR)/umount-wrapper.o diff --git a/ia64/umount-wrapper.c b/ia64/umount-wrapper.c new file mode 100644 index 0000000..2ebffd6 --- /dev/null +++ b/ia64/umount-wrapper.c @@ -0,0 +1,5 @@ +#include + +int umount(const char *target) { + return umount2(target, 0); +} -- 1.7.0.3