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