summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/util-linux/files/debian-bug392236.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/util-linux/files/debian-bug392236.patch')
-rw-r--r--meta/recipes-core/util-linux/files/debian-bug392236.patch203
1 files changed, 203 insertions, 0 deletions
diff --git a/meta/recipes-core/util-linux/files/debian-bug392236.patch b/meta/recipes-core/util-linux/files/debian-bug392236.patch
new file mode 100644
index 0000000000..fcd2046e34
--- /dev/null
+++ b/meta/recipes-core/util-linux/files/debian-bug392236.patch
@@ -0,0 +1,203 @@
1Index: util-linux-2.12r/fdisk/llseek.c
2===================================================================
3--- util-linux-2.12r.orig/fdisk/llseek.c 2003-07-13 23:13:33.000000000 +0200
4+++ util-linux-2.12r/fdisk/llseek.c 2007-04-04 19:01:14.000000000 +0200
5@@ -14,30 +14,23 @@
6
7 #ifdef __linux__
8
9-#ifdef HAVE_LLSEEK
10-#include <syscall.h>
11-
12-#else /* HAVE_LLSEEK */
13+#include <sys/syscall.h>
14+#ifndef HAVE_LLSEEK
15
16 #if defined(__alpha__) || defined(__ia64__) || defined(__s390x__)
17
18 #define my_llseek lseek
19
20 #else
21-#include <linux/unistd.h> /* for __NR__llseek */
22-
23-static int _llseek (unsigned int, unsigned long,
24- unsigned long, long long *, unsigned int);
25
26-#ifdef __NR__llseek
27+#ifdef SYS__llseek
28
29-static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high,
30- unsigned long, offset_low,long long *,result,
31- unsigned int, origin)
32+#define _llseek(fd, offset_high, offset_low, result, origin) \
33+ syscall(SYS__llseek, fd, offset_high, offset_low, result, origin)
34
35 #else
36
37-/* no __NR__llseek on compilation machine - might give it explicitly */
38+/* no SYS__llseek on compilation machine - might give it explicitly */
39 static int _llseek (unsigned int fd, unsigned long oh,
40 unsigned long ol, long long *result,
41 unsigned int origin) {
42Index: util-linux-2.12r/fdisk/sfdisk.c
43===================================================================
44--- util-linux-2.12r.orig/fdisk/sfdisk.c 2005-01-04 23:31:57.000000000 +0100
45+++ util-linux-2.12r/fdisk/sfdisk.c 2007-04-04 19:01:14.000000000 +0200
46@@ -48,7 +48,7 @@
47 #include <sys/ioctl.h>
48 #include <sys/stat.h>
49 #include <sys/utsname.h>
50-#include <linux/unistd.h> /* _syscall */
51+#include <sys/syscall.h>
52 #include "nls.h"
53 #include "common.h"
54
55@@ -177,9 +177,8 @@
56 #endif
57
58 #ifndef use_lseek
59-static __attribute__used
60-_syscall5(int, _llseek, unsigned int, fd, ulong, hi, ulong, lo,
61- loff_t *, res, unsigned int, wh);
62+#define _llseek(fd, hi, lo, res, wh) \
63+ syscall(SYS__llseek, fd, hi, lo, res, wh)
64 #endif
65
66 static int
67Index: util-linux-2.12r/lib/my_reboot.c
68===================================================================
69--- util-linux-2.12r.orig/lib/my_reboot.c 1999-07-09 04:56:36.000000000 +0200
70+++ util-linux-2.12r/lib/my_reboot.c 2007-04-04 19:01:14.000000000 +0200
71@@ -23,10 +23,11 @@
72 #else /* no USE_LIBC */
73
74 /* direct syscall version */
75-#include <linux/unistd.h>
76+#include <sys/syscall.h>
77
78-#ifdef _syscall3
79-_syscall3(int, reboot, int, magic, int, magic_too, int, cmd);
80+#ifdef SYS_reboot
81+#define reboot(magic, magic2, cmd) \
82+ syscall(SYS_reboot, magic, magic2, cmd)
83 #else
84 /* Let us hope we have a 3-argument reboot here */
85 extern int reboot(int, int, int);
86Index: util-linux-2.12r/misc-utils/setterm.c
87===================================================================
88--- util-linux-2.12r.orig/misc-utils/setterm.c 2003-10-17 18:17:51.000000000 +0200
89+++ util-linux-2.12r/misc-utils/setterm.c 2007-04-04 19:01:14.000000000 +0200
90@@ -119,14 +119,13 @@
91
92 #if __GNU_LIBRARY__ < 5
93 #ifndef __alpha__
94-# include <linux/unistd.h>
95-#define __NR_klogctl __NR_syslog
96-_syscall3(int, klogctl, int, type, char*, buf, int, len);
97+# include <sys/syscall.h>
98+#define klogctl(type, buf, len) \
99+ syscall(SYS_syslog, type, buf, len)
100 #else /* __alpha__ */
101 #define klogctl syslog
102 #endif
103 #endif
104-extern int klogctl(int type, char *buf, int len);
105
106 /* Constants. */
107
108Index: util-linux-2.12r/mount/swapon.c
109===================================================================
110--- util-linux-2.12r.orig/mount/swapon.c 2004-12-22 10:50:19.000000000 +0100
111+++ util-linux-2.12r/mount/swapon.c 2007-04-04 19:01:14.000000000 +0200
112@@ -82,11 +82,11 @@
113 #else
114 /* We want a swapon with two args, but have an old libc.
115 Build the kernel call by hand. */
116-#include <linux/unistd.h>
117-static
118-_syscall2(int, swapon, const char *, path, int, flags);
119-static
120-_syscall1(int, swapoff, const char *, path);
121+#include <sys/syscall.h>
122+#define swapon(path, flags) \
123+ syscall(SYS_swapon, path, flags)
124+#define swapoff(path) \
125+ syscall(SYS_swapoff, path)
126 #endif
127 #else
128 /* just do as libc says */
129Index: util-linux-2.12r/mount/umount.c
130===================================================================
131--- util-linux-2.12r.orig/mount/umount.c 2007-04-04 19:01:14.000000000 +0200
132+++ util-linux-2.12r/mount/umount.c 2007-04-04 19:02:22.000000000 +0200
133@@ -37,14 +37,13 @@
134 #else /* MNT_FORCE */
135
136 /* Does the present kernel source know about umount2? */
137-#include <linux/unistd.h>
138-#ifdef __NR_umount2
139+#include <sys/syscall.h>
140+#ifdef SYS_umount2
141
142-int umount2(const char *path, int flags);
143+#define umount2(path, flags) \
144+ syscall(SYS_umount2, path, flags)
145
146-_syscall2(int, umount2, const char *, path, int, flags);
147-
148-#else /* __NR_umount2 */
149+#else /* SYS_umount2 */
150
151 static int
152 umount2(const char *path, int flags) {
153@@ -52,7 +51,7 @@
154 errno = ENOSYS;
155 return -1;
156 }
157-#endif /* __NR_umount2 */
158+#endif /* SYS_umount2 */
159
160 #if !defined(MNT_FORCE)
161 /* dare not try to include <linux/mount.h> -- lots of errors */
162Index: util-linux-2.12r/partx/partx.c
163===================================================================
164--- util-linux-2.12r.orig/partx/partx.c 2004-08-23 22:13:27.000000000 +0200
165+++ util-linux-2.12r/partx/partx.c 2007-04-04 19:01:14.000000000 +0200
166@@ -338,10 +338,9 @@
167 #endif
168
169 #ifdef NEED__llseek
170-#include <linux/unistd.h> /* _syscall */
171-static
172-_syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo,
173- long long *, res, uint, wh);
174+#include <sys/syscall.h>
175+#define _llseek(fd, hi, lo, res, wh) \
176+ syscall(SYS__llseek, fd, hi, lo, res, wh)
177 #endif
178
179 static int
180Index: util-linux-2.12r/sys-utils/dmesg.c
181===================================================================
182--- util-linux-2.12r.orig/sys-utils/dmesg.c 2004-05-04 18:38:12.000000000 +0200
183+++ util-linux-2.12r/sys-utils/dmesg.c 2007-04-04 19:01:14.000000000 +0200
184@@ -29,7 +29,7 @@
185 * Only function 3 is allowed to non-root processes.
186 */
187
188-#include <linux/unistd.h>
189+#include <sys/syscall.h>
190 #include <stdio.h>
191 #include <getopt.h>
192 #include <stdlib.h>
193@@ -38,8 +38,8 @@
194 #if __GNU_LIBRARY__ < 5
195
196 #ifndef __alpha__
197-# define __NR_klogctl __NR_syslog
198- static inline _syscall3(int, klogctl, int, type, char *, b, int, len);
199+# define klogctl(type, b, len) \
200+ syscall(SYS_syslog, type, b, len)
201 #else /* __alpha__ */
202 #define klogctl syslog
203 #endif