getdents64 problem

Andreas Jaeger aj@suse.de
Fri Jan 19 02:25:00 GMT 2001


There was yesterday a thread on linux kernel with subject "nfs client
problem in kernel 2.4.0" which noticed some problems with our getdents
implementation.

Is the following patch ok?  Mogens, does it fix the problems you
noticed?

Andreas

2001-01-19  Andreas Jaeger  <aj@suse.de>

	* sysdeps/unix/sysv/linux/getdents.c (__GETDENTS): Make 64 bit
	clean.

============================================================
Index: sysdeps/unix/sysv/linux/getdents.c
--- sysdeps/unix/sysv/linux/getdents.c	2000/11/30 17:41:56	1.15
+++ sysdeps/unix/sysv/linux/getdents.c	2001/01/19 10:24:24
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1993,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -98,7 +98,7 @@
 __GETDENTS (int fd, char *buf, size_t nbytes)
 {
   DIRENT_TYPE *dp;
-  off_t last_offset = -1;
+  off64_t last_offset = -1;
   ssize_t retval;
 
 #ifdef __NR_getdents64
@@ -164,7 +164,7 @@
 		     otherwise signal overflow.  */
 		  if (last_offset != -1)
 		    {
-		      __lseek (fd, last_offset, SEEK_SET);
+		      __lseek64 (fd, last_offset, SEEK_SET);
 		      return (char *) dp - buf;
 		    }
 		  __set_errno (EOVERFLOW);

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


More information about the Libc-alpha mailing list