From a70eb6ff289cd2984f1e5af94e65cdc882606a23 Mon Sep 17 00:00:00 2001
From: youfeng <youfeng>
Date: Fri, 20 Feb 2004 06:03:58 +0000
Subject: [PATCH] b_2074 r = Adilger

 b 2074 comment 33 -- cleanup code using fstat()
---
 lnet/utils/debug.c             | 11 ++---------
 lnet/utils/l_ioctl.c           |  9 +++------
 lustre/portals/utils/debug.c   | 11 ++---------
 lustre/portals/utils/l_ioctl.c |  9 +++------
 4 files changed, 10 insertions(+), 30 deletions(-)

diff --git a/lnet/utils/debug.c b/lnet/utils/debug.c
index 14750d8899..2ca4dc3869 100644
--- a/lnet/utils/debug.c
+++ b/lnet/utils/debug.c
@@ -23,6 +23,8 @@
  *
  */
 
+#define __USE_FILE_OFFSET64
+
 #include <stdio.h>
 #include <netdb.h>
 #include <stdlib.h>
@@ -416,16 +418,7 @@ int jt_dbg_debug_file(int argc, char **argv)
                 return -1;
         }
 
-#ifndef __CYGWIN__
-# ifndef SYS_fstat64
-#  define __SYS_fstat__ SYS_fstat
-# else
-#  define __SYS_fstat__ SYS_fstat64
-# endif
-        rc = syscall(__SYS_fstat__, fd, &statbuf);
-#else
         rc = fstat(fd, &statbuf);
-#endif
         if (rc < 0) {
                 fprintf(stderr, "fstat failed: %s\n", strerror(errno));
                 goto out;
diff --git a/lnet/utils/l_ioctl.c b/lnet/utils/l_ioctl.c
index 58a408a8f1..1adcc8eb88 100644
--- a/lnet/utils/l_ioctl.c
+++ b/lnet/utils/l_ioctl.c
@@ -20,6 +20,8 @@
  *
  */
 
+#define __USE_FILE_OFFSET64
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -244,12 +246,7 @@ parse_dump(char * dump_file, int (*ioc_func)(int dev_id, int opc, void *))
                 exit(1);
         }
 
-#ifndef SYS_fstat64
-# define __SYS_fstat__ SYS_fstat
-#else
-# define __SYS_fstat__ SYS_fstat64
-#endif
-	if (syscall(__SYS_fstat__, fd, &st)) { 
+	if (fstat(fd, &st)) { 
 		perror("stat fails");
 		exit(1);
 	}
diff --git a/lustre/portals/utils/debug.c b/lustre/portals/utils/debug.c
index 14750d8899..2ca4dc3869 100644
--- a/lustre/portals/utils/debug.c
+++ b/lustre/portals/utils/debug.c
@@ -23,6 +23,8 @@
  *
  */
 
+#define __USE_FILE_OFFSET64
+
 #include <stdio.h>
 #include <netdb.h>
 #include <stdlib.h>
@@ -416,16 +418,7 @@ int jt_dbg_debug_file(int argc, char **argv)
                 return -1;
         }
 
-#ifndef __CYGWIN__
-# ifndef SYS_fstat64
-#  define __SYS_fstat__ SYS_fstat
-# else
-#  define __SYS_fstat__ SYS_fstat64
-# endif
-        rc = syscall(__SYS_fstat__, fd, &statbuf);
-#else
         rc = fstat(fd, &statbuf);
-#endif
         if (rc < 0) {
                 fprintf(stderr, "fstat failed: %s\n", strerror(errno));
                 goto out;
diff --git a/lustre/portals/utils/l_ioctl.c b/lustre/portals/utils/l_ioctl.c
index 58a408a8f1..1adcc8eb88 100644
--- a/lustre/portals/utils/l_ioctl.c
+++ b/lustre/portals/utils/l_ioctl.c
@@ -20,6 +20,8 @@
  *
  */
 
+#define __USE_FILE_OFFSET64
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -244,12 +246,7 @@ parse_dump(char * dump_file, int (*ioc_func)(int dev_id, int opc, void *))
                 exit(1);
         }
 
-#ifndef SYS_fstat64
-# define __SYS_fstat__ SYS_fstat
-#else
-# define __SYS_fstat__ SYS_fstat64
-#endif
-	if (syscall(__SYS_fstat__, fd, &st)) { 
+	if (fstat(fd, &st)) { 
 		perror("stat fails");
 		exit(1);
 	}
-- 
GitLab