1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../gpart/largefile.patch
5 # Copyright (C) 2006 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
17 diff -ur gpart-0.1h/src/gpart.c gpart-0.1h-fixed/src/gpart.c
18 --- gpart-0.1h/src/gpart.c 2001-02-07 19:08:08.000000000 +0100
19 +++ gpart-0.1h-fixed/src/gpart.c 2006-08-14 09:24:51.000000000 +0200
31 #include <sys/types.h>
35 static const char rcsid[] = "$Id: gpart.c,v 1.11 2001/02/07 18:08:08 mb Exp mb $";
36 diff -ur gpart-0.1h/src/l64seek.c gpart-0.1h-fixed/src/l64seek.c
37 --- gpart-0.1h/src/l64seek.c 2006-08-14 09:38:59.000000000 +0200
38 +++ gpart-0.1h-fixed/src/l64seek.c 2006-08-14 09:30:11.000000000 +0200
41 static int osptr = -1;
43 -#if defined(__linux__) && defined(__i386__)
44 -_syscall5(int,_llseek,uint,fd,ulong,hi,ulong,lo,loff_t *,res,uint,wh)
49 -off64_t l64seek(int fd,off64_t offset,int whence)
51 - off64_t ret = (off64_t)-1;
53 -#if defined(__linux__) && defined(__i386__)
55 - unsigned long ohi, olo;
57 - ohi = (unsigned long)((offset >> 32) & 0xFFFFFFFF);
58 - olo = (unsigned long)(offset & 0xFFFFFFFF);
59 - iret = _llseek(fd,ohi,olo,&ret,whence);
64 -#if defined(__FreeBSD__) || (defined(__linux__) && defined(__alpha__))
65 - ret = lseek(fd,offset,whence);
76 diff -ur gpart-0.1h/src/l64seek.h gpart-0.1h-fixed/src/l64seek.h
77 --- gpart-0.1h/src/l64seek.h 2000-12-13 23:56:07.000000000 +0100
78 +++ gpart-0.1h-fixed/src/l64seek.h 2006-08-14 09:26:06.000000000 +0200
86 - * define a type 'off64_t' which is at least 64bit, and a
87 - * lseek function capable of seeking with at least 64bit
92 -#if defined(__linux__)
93 -# include <linux/unistd.h>
94 -# include <sys/types.h>
95 - typedef int64_t off64_t;
97 +#define _FILE_OFFSET_BITS 64
98 +#define __USE_LARGEFILE64
99 +#define __USE_FILE_OFFSET64
103 -#if defined(__FreeBSD__)
104 - typedef off_t off64_t;
107 +#include <sys/types.h>
109 +typedef off_t off64_t;
110 typedef off64_t s64_t;
112 -off64_t l64seek(int fd, off64_t offset, int whence);
114 #define l64tell(fd) l64seek(fd,0,SEEK_CUR)
115 +#define l64seek lseek
120 --- gpart-0.1h/src/l64seek.h 2006-10-04 17:31:31.000000000 +0000
121 +++ gpart-0.1h-fixed/src/l64seek.h 2006-10-04 17:32:39.000000000 +0000
124 #include <sys/types.h>
126 -typedef off_t off64_t;
127 -typedef off64_t s64_t;
129 +typedef off_t s64_t;
131 #define l64tell(fd) l64seek(fd,0,SEEK_CUR)
132 #define l64seek lseek