]>
Commit | Line | Data |
---|---|---|
9dab7c7b ER |
1 | Debian patches |
2 | ||
3 | 0011-Add-new-defines-to-indicate-which-syscall-is-umount-3.diff | |
4 | 0012-Add-an-implementation-of-umount-3-for-ia64.diff . | |
5 | ||
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). | |
10 | ||
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 | |
16 | such a syscall exists | |
17 | ||
18 | In the currently-supported architectures there are four families: | |
19 | ||
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 | |
22 | 1-argument umount | |
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 | |
25 | --- | |
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(-) | |
31 | ||
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 | |
36 | @@ -413,6 +413,8 @@ | |
37 | #define __NR_timerfd 477 | |
38 | #define __NR_eventfd 478 | |
39 | ||
40 | +#define __NR_umount_without_flags __NR_oldumount | |
41 | +#define __NR_umount_with_flags __NR_umount | |
42 | ||
43 | #define syscall_weak(name,wsym,sym) \ | |
44 | .text ; \ | |
45 | diff --git a/ia64/syscalls.h b/ia64/syscalls.h | |
46 | index 907cb5c..7e86174 100644 | |
47 | --- a/ia64/syscalls.h | |
48 | +++ b/ia64/syscalls.h | |
49 | @@ -290,6 +290,8 @@ | |
50 | #define __NR_timerfd_settime 1311 | |
51 | #define __NR_timerfd_gettime 1312 | |
52 | ||
53 | +#define __NR_umount_with_flags __NR_umount | |
54 | + | |
55 | #define syscall(name, sym) \ | |
56 | .text; \ | |
57 | .globl 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 | |
62 | @@ -1,3 +1,7 @@ | |
63 | #include "syscalls.h" | |
64 | ||
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) | |
69 | +#endif | |
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 | |
74 | @@ -1,5 +1,7 @@ | |
75 | #include "syscalls.h" | |
76 | ||
77 | -#ifdef __NR_umount2 | |
78 | +#if defined(__NR_umount_with_flags) | |
79 | +syscall(umount_with_flags,umount2) | |
80 | +#elif defined(__NR_umount2) | |
81 | syscall(umount2,umount2) | |
82 | #endif | |
83 | -- | |
84 | 1.7.0.3 | |
85 | ||
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 | |
90 | ||
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. | |
94 | --- | |
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 | |
99 | ||
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 | |
104 | @@ -1,2 +1,2 @@ | |
105 | VPATH:=ia64:syscalls.s:$(VPATH) | |
b2599875 JR |
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 | |
9dab7c7b ER |
108 | diff --git a/ia64/umount-wrapper.c b/ia64/umount-wrapper.c |
109 | new file mode 100644 | |
110 | index 0000000..2ebffd6 | |
111 | --- /dev/null | |
112 | +++ b/ia64/umount-wrapper.c | |
113 | @@ -0,0 +1,5 @@ | |
114 | +#include <sys/mount.h> | |
115 | + | |
116 | +int umount(const char *target) { | |
117 | + return umount2(target, 0); | |
118 | +} | |
119 | -- | |
120 | 1.7.0.3 | |
121 |