1 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=392236
3 diff -ru util-linux-2.12r/fdisk/llseek.c util-linux-2.12r-new/fdisk/llseek.c
4 --- util-linux-2.12r/fdisk/llseek.c 2003-07-14 07:13:33.000000000 +1000
5 +++ util-linux-2.12r-new/fdisk/llseek.c 2006-10-13 15:50:09.000000000 +1000
13 -#else /* HAVE_LLSEEK */
14 +#include <sys/syscall.h>
17 #if defined(__alpha__) || defined(__ia64__) || defined(__s390x__)
19 #define my_llseek lseek
22 -#include <linux/unistd.h> /* for __NR__llseek */
24 -static int _llseek (unsigned int, unsigned long,
25 - unsigned long, long long *, unsigned int);
30 -static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high,
31 - unsigned long, offset_low,long long *,result,
32 - unsigned int, origin)
33 +#define _llseek(fd, offset_high, offset_low, result, origin) \
34 + syscall(SYS__llseek, fd, offset_high, offset_low, result, origin)
38 -/* no __NR__llseek on compilation machine - might give it explicitly */
39 +/* no SYS__llseek on compilation machine - might give it explicitly */
40 static int _llseek (unsigned int fd, unsigned long oh,
41 unsigned long ol, long long *result,
42 unsigned int origin) {
43 diff -ru util-linux-2.12r/fdisk/sfdisk.c util-linux-2.12r-new/fdisk/sfdisk.c
44 --- util-linux-2.12r/fdisk/sfdisk.c 2005-01-05 08:31:57.000000000 +1000
45 +++ util-linux-2.12r-new/fdisk/sfdisk.c 2006-10-13 15:48:42.000000000 +1000
47 #include <sys/ioctl.h>
49 #include <sys/utsname.h>
50 -#include <linux/unistd.h> /* _syscall */
51 +#include <sys/syscall.h>
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)
67 diff -ru util-linux-2.12r/lib/my_reboot.c util-linux-2.12r-new/lib/my_reboot.c
68 --- util-linux-2.12r/lib/my_reboot.c 1999-07-09 12:56:36.000000000 +1000
69 +++ util-linux-2.12r-new/lib/my_reboot.c 2006-10-13 20:46:42.000000000 +1000
71 #else /* no USE_LIBC */
73 /* direct syscall version */
74 -#include <linux/unistd.h>
75 +#include <sys/syscall.h>
78 -_syscall3(int, reboot, int, magic, int, magic_too, int, cmd);
80 +#define reboot(magic, magic2, cmd) \
81 + syscall(SYS_reboot, magic, magic2, cmd)
83 /* Let us hope we have a 3-argument reboot here */
84 extern int reboot(int, int, int);
85 diff -ru util-linux-2.12r/misc-utils/setterm.c util-linux-2.12r-new/misc-utils/setterm.c
86 --- util-linux-2.12r/misc-utils/setterm.c 2003-10-18 02:17:51.000000000 +1000
87 +++ util-linux-2.12r-new/misc-utils/setterm.c 2006-10-13 20:54:06.000000000 +1000
90 #if __GNU_LIBRARY__ < 5
92 -# include <linux/unistd.h>
93 -#define __NR_klogctl __NR_syslog
94 -_syscall3(int, klogctl, int, type, char*, buf, int, len);
95 +# include <sys/syscall.h>
96 +#define klogctl(type, buf, len) \
97 + syscall(SYS_syslog, type, buf, len)
99 #define klogctl syslog
102 -extern int klogctl(int type, char *buf, int len);
106 diff -ru util-linux-2.12r/mount/swapon.c util-linux-2.12r-new/mount/swapon.c
107 --- util-linux-2.12r/mount/swapon.c 2004-12-22 19:50:19.000000000 +1000
108 +++ util-linux-2.12r-new/mount/swapon.c 2006-10-13 16:08:19.000000000 +1000
111 /* We want a swapon with two args, but have an old libc.
112 Build the kernel call by hand. */
113 -#include <linux/unistd.h>
115 -_syscall2(int, swapon, const char *, path, int, flags);
117 -_syscall1(int, swapoff, const char *, path);
118 +#include <sys/syscall.h>
119 +#define swapon(path, flags) \
120 + syscall(SYS_swapon, path, flags)
121 +#define swapoff(path) \
122 + syscall(SYS_swapoff, path)
125 /* just do as libc says */
126 diff -ru util-linux-2.12r/mount/umount.c util-linux-2.12r-new/mount/umount.c
127 --- util-linux-2.12r/mount/umount.c 2005-09-11 04:07:38.000000000 +1000
128 +++ util-linux-2.12r-new/mount/umount.c 2006-10-13 20:43:22.000000000 +1000
130 #else /* MNT_FORCE */
132 /* Does the present kernel source know about umount2? */
133 -#include <linux/unistd.h>
135 +#include <sys/syscall.h>
138 -static int umount2(const char *path, int flags);
139 +#define umount2(path, flags) \
140 + syscall(SYS_umount2, path, flags)
142 -_syscall2(int, umount2, const char *, path, int, flags);
144 -#else /* __NR_umount2 */
145 +#else /* SYS_umount2 */
148 umount2(const char *path, int flags) {
153 -#endif /* __NR_umount2 */
154 +#endif /* SYS_umount2 */
156 #if !defined(MNT_FORCE)
157 /* dare not try to include <linux/mount.h> -- lots of errors */
158 diff -ru util-linux-2.12r/partx/partx.c util-linux-2.12r-new/partx/partx.c
159 --- util-linux-2.12r/partx/partx.c 2004-08-24 06:13:27.000000000 +1000
160 +++ util-linux-2.12r-new/partx/partx.c 2006-10-13 21:01:34.000000000 +1000
165 -#include <linux/unistd.h> /* _syscall */
167 -_syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo,
168 - long long *, res, uint, wh);
169 +#include <sys/syscall.h>
170 +#define _llseek(fd, hi, lo, res, wh) \
171 + syscall(SYS__llseek, fd, hi, lo, res, wh)
175 diff -ru util-linux-2.12r/sys-utils/dmesg.c util-linux-2.12r-new/sys-utils/dmesg.c
176 --- util-linux-2.12r/sys-utils/dmesg.c 2004-05-05 02:38:12.000000000 +1000
177 +++ util-linux-2.12r-new/sys-utils/dmesg.c 2006-10-13 21:05:10.000000000 +1000
179 * Only function 3 is allowed to non-root processes.
182 -#include <linux/unistd.h>
183 +#include <sys/syscall.h>
188 #if __GNU_LIBRARY__ < 5
191 -# define __NR_klogctl __NR_syslog
192 - static inline _syscall3(int, klogctl, int, type, char *, b, int, len);
193 +# define klogctl(type, b, len) \
194 + syscall(SYS_syslog, type, b, len)
195 #else /* __alpha__ */
196 #define klogctl syslog