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.
123 lines
3.1 KiB
123 lines
3.1 KiB
18 years ago
|
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
|
||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
|
||
17 years ago
|
#
|
||
18 years ago
|
# Filename: package/.../gpart/largefile.patch
|
||
16 years ago
|
# Copyright (C) 2006 - 2008 The OpenSDE Project
|
||
18 years ago
|
# Copyright (C) 2006 The T2 SDE Project
|
||
17 years ago
|
#
|
||
18 years ago
|
# More information can be found in the files COPYING and README.
|
||
17 years ago
|
#
|
||
18 years ago
|
# This patch file is dual-licensed. It is available under the license the
|
||
|
# patched project is licensed under, as long as it is an OpenSource license
|
||
|
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
|
||
|
# of the GNU General Public License as published by the Free Software
|
||
|
# Foundation; either version 2 of the License, or (at your option) any later
|
||
|
# version.
|
||
|
# --- SDE-COPYRIGHT-NOTE-END ---
|
||
|
|
||
|
Fixed largefile support (from T2 r19003)
|
||
|
|
||
|
diff -ur gpart-0.1h/src/gpart.c gpart-0.1h-fixed/src/gpart.c
|
||
|
--- gpart-0.1h/src/gpart.c 2001-02-07 19:08:08.000000000 +0100
|
||
|
+++ gpart-0.1h-fixed/src/gpart.c 2006-08-14 09:24:51.000000000 +0200
|
||
|
@@ -45,6 +45,7 @@
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
+#include "gpart.h"
|
||
|
|
||
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
@@ -56,7 +57,6 @@
|
||
|
#include <errno.h>
|
||
|
#include <sys/stat.h>
|
||
|
#include <sys/types.h>
|
||
|
-#include "gpart.h"
|
||
|
|
||
|
|
||
|
static const char rcsid[] = "$Id: gpart.c,v 1.11 2001/02/07 18:08:08 mb Exp mb $";
|
||
|
diff -ur gpart-0.1h/src/l64seek.c gpart-0.1h-fixed/src/l64seek.c
|
||
|
--- gpart-0.1h/src/l64seek.c 2006-08-14 09:38:59.000000000 +0200
|
||
|
+++ gpart-0.1h-fixed/src/l64seek.c 2006-08-14 09:30:11.000000000 +0200
|
||
|
@@ -26,36 +26,6 @@
|
||
|
} ostck[OSTACKLEN];
|
||
|
static int osptr = -1;
|
||
|
|
||
|
-#if defined(__linux__) && defined(__i386__)
|
||
|
-_syscall5(int,_llseek,uint,fd,ulong,hi,ulong,lo,loff_t *,res,uint,wh)
|
||
|
-#endif
|
||
|
-
|
||
|
-
|
||
|
-
|
||
|
-off64_t l64seek(int fd,off64_t offset,int whence)
|
||
|
-{
|
||
|
- off64_t ret = (off64_t)-1;
|
||
|
-
|
||
|
-#if defined(__linux__) && defined(__i386__)
|
||
|
- int iret;
|
||
|
- unsigned long ohi, olo;
|
||
|
-
|
||
|
- ohi = (unsigned long)((offset >> 32) & 0xFFFFFFFF);
|
||
|
- olo = (unsigned long)(offset & 0xFFFFFFFF);
|
||
|
- iret = _llseek(fd,ohi,olo,&ret,whence);
|
||
|
- if (iret == -1)
|
||
|
- ret = (off64_t)-1;
|
||
|
-#endif
|
||
|
-
|
||
|
-#if defined(__FreeBSD__) || (defined(__linux__) && defined(__alpha__))
|
||
|
- ret = lseek(fd,offset,whence);
|
||
|
-#endif
|
||
|
-
|
||
|
- return (ret);
|
||
|
-}
|
||
|
-
|
||
|
-
|
||
|
-
|
||
|
int l64opush(int fd)
|
||
|
{
|
||
|
s64_t fpos;
|
||
|
diff -ur gpart-0.1h/src/l64seek.h gpart-0.1h-fixed/src/l64seek.h
|
||
|
--- gpart-0.1h/src/l64seek.h 2000-12-13 23:56:07.000000000 +0100
|
||
|
+++ gpart-0.1h-fixed/src/l64seek.h 2006-08-14 09:26:06.000000000 +0200
|
||
|
@@ -17,31 +17,21 @@
|
||
|
#ifndef _L64SEEK_H
|
||
|
#define _L64SEEK_H
|
||
|
|
||
|
-#include <unistd.h>
|
||
|
-
|
||
|
-/*
|
||
|
- * define a type 'off64_t' which is at least 64bit, and a
|
||
|
- * lseek function capable of seeking with at least 64bit
|
||
|
- * offsets.
|
||
|
- */
|
||
|
-
|
||
|
-
|
||
|
-#if defined(__linux__)
|
||
|
-# include <linux/unistd.h>
|
||
|
-# include <sys/types.h>
|
||
|
- typedef int64_t off64_t;
|
||
|
-#endif
|
||
|
+#define _FILE_OFFSET_BITS 64
|
||
|
+#define __USE_LARGEFILE64
|
||
|
+#define __USE_FILE_OFFSET64
|
||
|
|
||
|
+#include <unistd.h>
|
||
|
|
||
|
-#if defined(__FreeBSD__)
|
||
|
- typedef off_t off64_t;
|
||
|
-#endif
|
||
|
-
|
||
|
+#include <sys/types.h>
|
||
|
|
||
|
+typedef off_t off64_t;
|
||
|
typedef off64_t s64_t;
|
||
|
|
||
|
-off64_t l64seek(int fd, off64_t offset, int whence);
|
||
|
+
|
||
|
#define l64tell(fd) l64seek(fd,0,SEEK_CUR)
|
||
|
+#define l64seek lseek
|
||
|
+
|
||
|
int l64opush(int);
|
||
|
s64_t l64opop(int);
|
||
|
|