OpenSDE Packages Database (without history before r20070)
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.

122 lines
3.1 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../gpart/largefile.patch
  5. # Copyright (C) 2006 - 2008 The OpenSDE Project
  6. # Copyright (C) 2006 The T2 SDE Project
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This patch file is dual-licensed. It is available under the license the
  11. # patched project is licensed under, as long as it is an OpenSource license
  12. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  13. # of the GNU General Public License as published by the Free Software
  14. # Foundation; either version 2 of the License, or (at your option) any later
  15. # version.
  16. # --- SDE-COPYRIGHT-NOTE-END ---
  17. Fixed largefile support (from T2 r19003)
  18. diff -ur gpart-0.1h/src/gpart.c gpart-0.1h-fixed/src/gpart.c
  19. --- gpart-0.1h/src/gpart.c 2001-02-07 19:08:08.000000000 +0100
  20. +++ gpart-0.1h-fixed/src/gpart.c 2006-08-14 09:24:51.000000000 +0200
  21. @@ -45,6 +45,7 @@
  22. *
  23. */
  24. +#include "gpart.h"
  25. #include <stdio.h>
  26. #include <stdlib.h>
  27. @@ -56,7 +57,6 @@
  28. #include <errno.h>
  29. #include <sys/stat.h>
  30. #include <sys/types.h>
  31. -#include "gpart.h"
  32. static const char rcsid[] = "$Id: gpart.c,v 1.11 2001/02/07 18:08:08 mb Exp mb $";
  33. diff -ur gpart-0.1h/src/l64seek.c gpart-0.1h-fixed/src/l64seek.c
  34. --- gpart-0.1h/src/l64seek.c 2006-08-14 09:38:59.000000000 +0200
  35. +++ gpart-0.1h-fixed/src/l64seek.c 2006-08-14 09:30:11.000000000 +0200
  36. @@ -26,36 +26,6 @@
  37. } ostck[OSTACKLEN];
  38. static int osptr = -1;
  39. -#if defined(__linux__) && defined(__i386__)
  40. -_syscall5(int,_llseek,uint,fd,ulong,hi,ulong,lo,loff_t *,res,uint,wh)
  41. -#endif
  42. -
  43. -
  44. -
  45. -off64_t l64seek(int fd,off64_t offset,int whence)
  46. -{
  47. - off64_t ret = (off64_t)-1;
  48. -
  49. -#if defined(__linux__) && defined(__i386__)
  50. - int iret;
  51. - unsigned long ohi, olo;
  52. -
  53. - ohi = (unsigned long)((offset >> 32) & 0xFFFFFFFF);
  54. - olo = (unsigned long)(offset & 0xFFFFFFFF);
  55. - iret = _llseek(fd,ohi,olo,&ret,whence);
  56. - if (iret == -1)
  57. - ret = (off64_t)-1;
  58. -#endif
  59. -
  60. -#if defined(__FreeBSD__) || (defined(__linux__) && defined(__alpha__))
  61. - ret = lseek(fd,offset,whence);
  62. -#endif
  63. -
  64. - return (ret);
  65. -}
  66. -
  67. -
  68. -
  69. int l64opush(int fd)
  70. {
  71. s64_t fpos;
  72. diff -ur gpart-0.1h/src/l64seek.h gpart-0.1h-fixed/src/l64seek.h
  73. --- gpart-0.1h/src/l64seek.h 2000-12-13 23:56:07.000000000 +0100
  74. +++ gpart-0.1h-fixed/src/l64seek.h 2006-08-14 09:26:06.000000000 +0200
  75. @@ -17,31 +17,21 @@
  76. #ifndef _L64SEEK_H
  77. #define _L64SEEK_H
  78. -#include <unistd.h>
  79. -
  80. -/*
  81. - * define a type 'off64_t' which is at least 64bit, and a
  82. - * lseek function capable of seeking with at least 64bit
  83. - * offsets.
  84. - */
  85. -
  86. -
  87. -#if defined(__linux__)
  88. -# include <linux/unistd.h>
  89. -# include <sys/types.h>
  90. - typedef int64_t off64_t;
  91. -#endif
  92. +#define _FILE_OFFSET_BITS 64
  93. +#define __USE_LARGEFILE64
  94. +#define __USE_FILE_OFFSET64
  95. +#include <unistd.h>
  96. -#if defined(__FreeBSD__)
  97. - typedef off_t off64_t;
  98. -#endif
  99. -
  100. +#include <sys/types.h>
  101. +typedef off_t off64_t;
  102. typedef off64_t s64_t;
  103. -off64_t l64seek(int fd, off64_t offset, int whence);
  104. +
  105. #define l64tell(fd) l64seek(fd,0,SEEK_CUR)
  106. +#define l64seek lseek
  107. +
  108. int l64opush(int);
  109. s64_t l64opop(int);