1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
From bbfde6fb367238b0b20f9b46db3b63936d55aedf Mon Sep 17 00:00:00 2001
From: Philip Blundell <pb@debian.org>
Date: Sun, 16 Dec 2001 13:53:51 +0000
Subject: set _FILE_OFFSET_BITS=64 for blkio library and remove "my_llseek" hack
Bug-Debian: 123365
---
lib/blkio/Makefile | 2 +-
lib/blkio/open.c | 1 +
lib/blkio/read.c | 10 ++++++++++
lib/blkio/write.c | 10 ++++++++++
4 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/lib/blkio/Makefile b/lib/blkio/Makefile
index 8423fcc..f335ac6 100644
--- a/lib/blkio/Makefile
+++ b/lib/blkio/Makefile
@@ -2,7 +2,7 @@ AR = ar
CC = cc
ARFLAGS = rc
CFLAGS = -O2 -Wall -g
-M_CPPFLAGS = -DUNIX -I..
+M_CPPFLAGS = -DUNIX -I.. -D_FILE_OFFSET_BITS=64
CPPFLAGS =
OBJS = close.o getgeo.o open.o read.o setblocksz.o setgeo.o write.o
diff --git a/lib/blkio/open.c b/lib/blkio/open.c
index a533420..21fc7b1 100644
--- a/lib/blkio/open.c
+++ b/lib/blkio/open.c
@@ -10,6 +10,7 @@
#include <assert.h>
#include <string.h>
#include <stdlib.h>
+#include <errno.h>
#include "util/debug.h"
#include "util/error.h"
diff --git a/lib/blkio/read.c b/lib/blkio/read.c
index a3ff0d3..7cc6961 100644
--- a/lib/blkio/read.c
+++ b/lib/blkio/read.c
@@ -7,6 +7,8 @@
*
* Read data from device on RiscOS architecture
*/
+#include <errno.h>
+
#include "util/debug.h"
#include "util/error.h"
#include "blkio.h"
@@ -64,6 +66,12 @@ static u_int read_block(blkio_t *blkio, void *data, blk_t block, u_int nr_blocks
#include <unistd.h>
#include <syscall.h>
+#if _FILE_OFFSET_BITS == 64
+
+#define my_llseek lseek
+
+#else
+
#undef SYS__llseek
#define SYS__llseek (__NR__llseek - __NR_SYSCALL_BASE)
@@ -82,6 +90,8 @@ static loff_t my_llseek(int fd, loff_t off, int whence)
return off;
}
+#endif
+
static u_int read_block(blkio_t *blkio, void *data, blk_t block, u_int nr_blocks)
{
u_int len, res = 0;
diff --git a/lib/blkio/write.c b/lib/blkio/write.c
index 9e4532c..7bab35e 100644
--- a/lib/blkio/write.c
+++ b/lib/blkio/write.c
@@ -7,6 +7,8 @@
*
* Write data to device on RiscOS architecture
*/
+#include <errno.h>
+
#include "util/debug.h"
#include "util/error.h"
#include "blkio.h"
@@ -64,6 +66,12 @@ static u_int write_block(blkio_t *blkio, const void *data, blk_t block, u_int nr
#include <unistd.h>
#include <syscall.h>
+#if _FILE_OFFSET_BITS == 64
+
+#define my_llseek lseek
+
+#else
+
#undef SYS__llseek
#define SYS__llseek (__NR__llseek - __NR_SYSCALL_BASE)
@@ -82,6 +90,8 @@ static loff_t my_llseek(int fd, loff_t off, int whence)
return off;
}
+#endif
+
static u_int write_block(blkio_t *blkio, const void *data, blk_t block, u_int nr_blocks)
{
u_int len, res = 0;
|