bug-coreutils
[Top][All Lists]
Advanced

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

RE: gsort problem


From: Simon Wing-Tang
Subject: RE: gsort problem
Date: Wed, 24 May 2006 11:19:45 +1000

Hi Guys,
        I applied this patch and tried to sort the 11GB file.  This time it 
sorted correctly and created the temporary files over 2GB as follows....

[udmdwdev]-root > timex ../../rfx/bin/gsort_cc_patch01 -T . -k 1,1 -k 2,2 -t 
"|" rfx63737_unsorted.dat.bu -o sort.3

real  1:15:17.62
user  1:01:50.41
sys      5:37.28

[udmdwdev]-root >

[udmdwdev]-root > ls -lrt sort*
-rw-------   1 root       medwusr    439997404 May 24 09:21 sortySK5gm
-rw-------   1 root       medwusr    440008316 May 24 09:24 sortTpTsIM
-rw-------   1 root       medwusr    440017552 May 24 09:26 sortqbf7ap
-rw-------   1 root       medwusr    440006432 May 24 09:28 sortmJoe0d
-rw-------   1 root       medwusr    439996246 May 24 09:30 sortaPF9e3
-rw-------   1 root       medwusr    440008300 May 24 09:32 sortLc97aj
-rw-------   1 root       medwusr    440001247 May 24 09:35 sortTMOHqx
-rw-------   1 root       medwusr    440002558 May 24 09:37 sortTDk0HE
-rw-------   1 root       medwusr    440000706 May 24 09:39 sortXowRfR
-rw-------   1 root       medwusr    193708302 May 24 09:39 sortSF4Wqn
-rw-------   1 root       medwusr    7040124685 May 24 09:49 sortI4US5W
-rw-r--r--   1 root       medwusr    11146461184 May 24 10:03 sort.3

[udmdwdev]-root >

So, where do we go from here ?  Would this code change be incorporated in the 
next release ?

        Simon

-----Original Message-----
From: Paul Eggert [mailto:address@hidden
Sent: Tuesday, 23 May 2006 18:11
To: Simon Wing-Tang
Cc: address@hidden; Anthony Tiemens
Subject: Re: gsort problem


Does the following patch to lib/tempname.c fix things for you?

--- tempname.c.~1.17.~  2005-09-21 23:05:39.000000000 -0700
+++ tempname.c  2006-05-23 01:09:20.000000000 -0700
@@ -66,14 +66,16 @@

 #if _LIBC
 # define struct_stat64 struct stat64
+# define small_open __open
+# define large_open __open64
 #else
 # include "stat-macros.h"
 # define struct_stat64 struct stat
+# define small_open open
+# define large_open open
 # define __getpid getpid
 # define __gettimeofday gettimeofday
 # define __mkdir mkdir
-# define __open open
-# define __open64 open
 # define __lxstat64(version, file, buf) lstat (file, buf)
 # define __xstat64(version, file, buf) stat (file, buf)
 #endif
@@ -269,11 +271,11 @@ __gen_tempname (char *tmpl, int kind)
       switch (kind)
        {
        case __GT_FILE:
-         fd = __open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+         fd = small_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
          break;

        case __GT_BIGFILE:
-         fd = __open64 (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+         fd = large_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
          break;

        case __GT_DIR:

This email and any attachments may contain privileged and confidential 
information and are intended for the named addressee only. If you have received 
this e-mail in error, please notify the sender and delete this e-mail 
immediately. Any confidentiality, privilege or copyright is not waived or lost 
because this e-mail has been sent to you in error. It is your responsibility to 
check this e-mail and any attachments for viruses.  No warranty is made that 
this material is free from computer virus or any other defect or error.  Any 
loss/damage incurred by using this material is not the sender's responsibility. 
 The sender's entire liability will be limited to resupplying the material.




reply via email to

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