3 0011-Add-new-defines-to-indicate-which-syscall-is-umount-3.diff
4 0012-Add-an-implementation-of-umount-3-for-ia64.diff .
6 From a35138d49e022dd94fd91974fa2ed2ef6dd58a90 Mon Sep 17 00:00:00 2001
7 From: Simon McVittie <smcv@debian.org>
8 Date: Sat, 3 Jan 2009 12:04:48 +0000
9 Subject: [PATCH 11/13] Add new #defines to indicate which syscall is umount(3) and which is umount2(3).
11 * on architectures where __NR_umount is umount(3) and __NR_umount2 is
12 umount2(3), don't do anything special
13 * on architectures where this is not the case, define __NR_umount_with_flags
14 so that it's umount2(3)
15 * define __NR_umount_without_flags to be umount(3) on architectures where
18 In the currently-supported architectures there are four families:
20 * on i386, arm etc., __NR_umount takes one argument and __NR_umount2 takes two
21 * on x86_64 and parisc __NR_umount2 takes two arguments and there is no
23 * on alpha, __NR_oldumount takes one argument and __NR_umount takes two
24 * on ia64, __NR_umount takes two arguments and there is no 1-argument umount
26 alpha/syscalls.h | 2 ++
27 ia64/syscalls.h | 2 ++
28 syscalls.s/umount.S | 4 ++++
29 syscalls.s/umount2.S | 4 +++-
30 4 files changed, 11 insertions(+), 1 deletions(-)
32 diff --git a/alpha/syscalls.h b/alpha/syscalls.h
33 index 1ab37e8..7636b0c 100644
34 --- a/alpha/syscalls.h
35 +++ b/alpha/syscalls.h
37 #define __NR_timerfd 477
38 #define __NR_eventfd 478
40 +#define __NR_umount_without_flags __NR_oldumount
41 +#define __NR_umount_with_flags __NR_umount
43 #define syscall_weak(name,wsym,sym) \
45 diff --git a/ia64/syscalls.h b/ia64/syscalls.h
46 index 907cb5c..7e86174 100644
50 #define __NR_timerfd_settime 1311
51 #define __NR_timerfd_gettime 1312
53 +#define __NR_umount_with_flags __NR_umount
55 #define syscall(name, sym) \
58 diff --git a/syscalls.s/umount.S b/syscalls.s/umount.S
59 index 4a423d9..89793e2 100644
60 --- a/syscalls.s/umount.S
61 +++ b/syscalls.s/umount.S
65 +#if defined(__NR_umount_without_flags)
66 +syscall(umount_without_flags,umount)
67 +#elif !defined(__NR_umount_with_flags) || (__NR_umount != __NR_umount_with_flags)
68 syscall(umount,umount)
70 diff --git a/syscalls.s/umount2.S b/syscalls.s/umount2.S
71 index b27b353..5742416 100644
72 --- a/syscalls.s/umount2.S
73 +++ b/syscalls.s/umount2.S
78 +#if defined(__NR_umount_with_flags)
79 +syscall(umount_with_flags,umount2)
80 +#elif defined(__NR_umount2)
81 syscall(umount2,umount2)
86 From 4510d9f53bd77bc8b97d37c78b499d85d0a97d4f Mon Sep 17 00:00:00 2001
87 From: Simon McVittie <smcv@debian.org>
88 Date: Sat, 3 Jan 2009 12:11:42 +0000
89 Subject: [PATCH 12/13] Add an implementation of umount(3) for ia64
91 Like x86_64 and parisc, ia64 lacks a single-argument umount syscall, so we
92 need to provide a stub implementation that just calls umount2(path, 0).
93 I don't know ia64 assembler, so this one is in C.
95 ia64/Makefile.add | 2 +-
96 ia64/umount-wrapper.c | 5 +++++
97 2 files changed, 6 insertions(+), 1 deletions(-)
98 create mode 100644 ia64/umount-wrapper.c
100 diff --git a/ia64/Makefile.add b/ia64/Makefile.add
101 index f660930..ca00e4d 100644
102 --- a/ia64/Makefile.add
103 +++ b/ia64/Makefile.add
105 VPATH:=ia64:syscalls.s:$(VPATH)
106 -LIBOBJ+=$(OBJDIR)/__time.o $(OBJDIR)/__waitpid.o $(OBJDIR)/__alarm.o $(OBJDIR)/__CAS.o $(OBJDIR)/__pause.o
107 +LIBOBJ+=$(OBJDIR)/__time.o $(OBJDIR)/__waitpid.o $(OBJDIR)/__alarm.o $(OBJDIR)/__CAS.o $(OBJDIR)/__pause.o $(OBJDIR)/umount-wrapper.o
108 diff --git a/ia64/umount-wrapper.c b/ia64/umount-wrapper.c
110 index 0000000..2ebffd6
112 +++ b/ia64/umount-wrapper.c
114 +#include <sys/mount.h>
116 +int umount(const char *target) {
117 + return umount2(target, 0);