bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

findutils-4.1 /Solaris Largefile patch


From: srevilak
Subject: findutils-4.1 /Solaris Largefile patch
Date: Tue, 3 Jun 2003 16:34:27 -0400 (EDT)

Hello gnu-utils folks.

I'd like to submit a patch to gnu find (from findutils-4.1) to help it
work better with largefiles on Solaris.  Specifically, this is the
sort of thing that I'm trying to overcome:


/usr/local/gnu/bin/find  /ora/5/oradata/odm/dmdate03.dbf 
-ls/usr/local/gnu/bin/find: /ora/5/oradata/odm/dmdate03.dbf: Value too large 
for defined data type

(The above file is ~ 10gb).

What I've done at first is

  $ export CFLAGS=`getconf LFS_CFLAGS`
  # CFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
  $ ./configure --prefix=/usr/local/gnu
  $ make

This is a partial fix:

  $ ~/tmp/find/findutils-4.1/find/find  /ora/5/oradata/odm/dmdate03.dbf -ls
     0    0 -rw-rw----   1 oracle   oinstall        2 Jun  3 16:14 
/ora/5/oradata/odm/dmdate03.dbf

[note zero sizes above].

With "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64", sys/types.h and
sys/stat.h on Solaris come up with the following:

  ino_t      unsigned long long
  off_t      long long
  blksize_t  long
  blkcnt_t   long long

Where `-ls' is truncating the values to the most significant 32 bits.

I've applied a small patch to lib/listfiles.c, to give printf a little
more breathing room, and this seems to produce correct results.

   $~/tmp/find/findutils-4.1/find/find  /ora/5/oradata/odm/dmdate03.dbf -ls
    10371 10245016 -rw-rw----   1 oracle   oinstall 10485768192 Jun  3 16:14 
/ora/5/oradata/odm/dmdate03.dbf


The patch is appended below.  I'm not sure if it would be necessary to
make similar changes in other portions of the program (perhaps
make_segment() in find/parser.c ?)


At any rate - the diffs are below.  I hope that you'll consider
incorporating this into a future release of the program.

Thanks.

------------------------------------------------------------------
--- lib/listfile.c.ORIG 1994-11-02 15:59:24.000000000 -0500
+++ lib/listfile.c      2003-06-03 16:25:13.115001000 -0400
@@ -153,9 +153,9 @@
     }
   timebuf[16] = 0;

-  fprintf (stream, "%6lu ", statp->st_ino);
+  fprintf (stream, "%6llu ", statp->st_ino);

-  fprintf (stream, "%4u ", convert_blocks (ST_NBLOCKS (statp), kilobytes));
+  fprintf (stream, "%4llu ", convert_blocks (ST_NBLOCKS (statp), kilobytes));

   /* The space between the mode and the number of links is the POSIX
      "optional alternate access method flag". */
@@ -172,7 +172,7 @@
     fprintf (stream, "         ");
 #endif
   else
-    fprintf (stream, "%8lu ", statp->st_size);
+    fprintf (stream, "%8llu ", statp->st_size);

   fprintf (stream, "%s ", timebuf + 4);

------------------------------------------------------------------

-- 
Steve Revilak
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]