[DRBD-cvs] svn commit by lars - r2256 - trunk/benchmark - make it actually work with 64 bit file offsets

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Tue Jul 4 11:34:04 CEST 2006


Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: lars
Date: 2006-07-04 11:34:04 +0200 (Tue, 04 Jul 2006)
New Revision: 2256

Modified:
   trunk/benchmark/dm.c
Log:
make it actually work with 64 bit file offsets

Modified: trunk/benchmark/dm.c
===================================================================
--- trunk/benchmark/dm.c	2006-07-04 09:33:31 UTC (rev 2255)
+++ trunk/benchmark/dm.c	2006-07-04 09:34:04 UTC (rev 2256)
@@ -22,16 +22,16 @@
 
  */
 
+#define _GNU_SOURCE
+#define _FILE_OFFSET_BITS 64
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/mount.h>
-#define __USE_LARGEFILE64
 #include <fcntl.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <sys/time.h>
-#define _GNU_SOURCE
 #include <getopt.h>
 #include <string.h>
 
@@ -147,7 +147,7 @@
 			break;
 		switch (c) {
 		case 'i':
-			in_fd = open(optarg, O_RDONLY | O_LARGEFILE);
+			in_fd = open(optarg, O_RDONLY);
 			if (in_fd == -1) {
 				fprintf(stderr,
 					"Can not open input file/device\n");
@@ -207,7 +207,7 @@
 	}
 
 	if (seek_offs_i) {
-		if (lseek64(in_fd, seek_offs_i, SEEK_SET) == -1) {
+		if (lseek(in_fd, seek_offs_i, SEEK_SET) == -1) {
 			fprintf(stderr,
 				"Can not lseek(2) in input file/device\n");
 			exit(20);
@@ -215,7 +215,7 @@
 	}
 
 	if (seek_offs_o) {
-		if (lseek64(out_fd, seek_offs_o, SEEK_SET) == -1) {
+		if (lseek(out_fd, seek_offs_o, SEEK_SET) == -1) {
 			fprintf(stderr,
 				"Can not lseek(2) in output file/device\n");
 			exit(20);



More information about the drbd-cvs mailing list