mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.5 KiB

  1. --- ./fdisk/llseek.c 2007-05-21 11:45:41.000000000 +0200
  2. +++ ./fdisk/llseek.c 2007-05-21 11:53:14.000000000 +0200
  3. @@ -5,6 +5,7 @@
  4. * under the terms of the GNU Public License.
  5. */
  6. +#include <sys/syscall.h>
  7. #include <sys/types.h>
  8. #include <errno.h>
  9. @@ -26,27 +27,16 @@
  10. #else
  11. #include <linux/unistd.h> /* for __NR__llseek */
  12. -static int _llseek (unsigned int, unsigned long,
  13. - unsigned long, long long *, unsigned int);
  14. -
  15. -#ifdef __NR__llseek
  16. -
  17. -static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high,
  18. - unsigned long, offset_low,long long *,result,
  19. - unsigned int, origin)
  20. -
  21. -#else
  22. -
  23. -/* no __NR__llseek on compilation machine - might give it explicitly */
  24. static int _llseek (unsigned int fd, unsigned long oh,
  25. unsigned long ol, long long *result,
  26. unsigned int origin) {
  27. - errno = ENOSYS;
  28. - return -1;
  29. +#ifdef __NR__llseek
  30. + return syscall(__NR__llseek, fd, oh, ol, result, origin);
  31. +#else
  32. + return result = lseek64(fd, (oh<<32) | ol, origin);
  33. +#endif
  34. }
  35. -#endif
  36. -
  37. static long long my_llseek (unsigned int fd, long long offset,
  38. unsigned int origin)
  39. {
  40. --- ./fdisk/sfdisk.c 2007-05-21 11:48:48.000000000 +0200
  41. +++ ./fdisk/sfdisk.c 2007-05-21 11:54:32.000000000 +0200
  42. @@ -47,6 +47,7 @@
  43. #include <getopt.h>
  44. #include <sys/ioctl.h>
  45. #include <sys/stat.h>
  46. +#include <sys/syscall.h>
  47. #include <sys/utsname.h>
  48. #include <linux/unistd.h> /* _syscall */
  49. #include "nls.h"
  50. @@ -177,9 +178,15 @@
  51. #endif
  52. #ifndef use_lseek
  53. -static __attribute__used
  54. -_syscall5(int, _llseek, unsigned int, fd, ulong, hi, ulong, lo,
  55. - loff_t *, res, unsigned int, wh);
  56. +static int _llseek (unsigned int fd, unsigned long oh,
  57. + unsigned long ol, long long *result,
  58. + unsigned int origin) {
  59. +#ifdef __NR__llseek
  60. + return syscall(__NR__llseek, fd, oh, ol, result, origin);
  61. +#else
  62. + return result = lseek64(fd, (oh<<32) | ol, origin);
  63. +#endif
  64. +}
  65. #endif
  66. static int
  67. --- ./partx/partx.c 2007-05-21 22:30:42.000000000 +0200
  68. +++ ./partx/partx.c 2007-05-21 22:31:21.000000000 +0200
  69. @@ -339,10 +339,13 @@
  70. #endif
  71. #ifdef NEED__llseek
  72. +#include <sys/syscall.h>
  73. #include <linux/unistd.h> /* _syscall */
  74. -static
  75. -_syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo,
  76. - long long *, res, uint, wh);
  77. +static int _llseek (unsigned int fd, unsigned long oh,
  78. + unsigned long ol, long long *result,
  79. + unsigned int origin) {
  80. + return syscall(__NR__llseek, fd, oh, ol, result, origin);
  81. +}
  82. #endif
  83. static int