Home | History | Annotate | Download | only in sort
History log of /src/usr.bin/sort/tmp.c
RevisionDateAuthorComments
 1.16  06-Nov-2009  joerg Retire __SCCSID. It has only archeological value now. Also retire lint
conditional around __RCSID, lint can handle that fine.
 1.15  26-Sep-2009  dsl Move all the fopen() calls out of the record read routines into the callers.
Split the merge sort so that fsort() can pass the 'FILE *' of the temporary
files to be merged into the merge code.
Don't rely on realloc() not moving the end address of a buffer!
Rework merge sort so that it sorts pointers to 'struct mfile' and only
copies about sort record descriptors.
No functional change intended.
 1.14  15-Aug-2009  dsl Ansify.
I'm looking at fixing the 'sort -n' fubars, but this code is an
inpeneterable mess - which needs some fixing first!
 1.13  28-Apr-2008  martin branches: 1.13.6; 1.13.12;
Remove clause 3 and 4 from TNF licenses
 1.12  21-Feb-2007  hubertf branches: 1.12.10;
<ctype.h> is unused. What's still needed is <sys/cdefs.h> (which is
usually included at that place anyways).

From Slava Semushin <slava.semushin@gmail.com>.
 1.11  07-Aug-2003  jdolecek add TNF copyright
 1.10  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.9  23-Dec-2002  jdolecek simplify a bit (no need for separate 'char *path')
 1.8  23-Feb-2001  jdolecek Use MAXPATHLEN (which is 1024) instead of _POSIX_PATH_MAX (which is only 255).
This change tracks change in rev 1.25 of sort.c by Christos Zoulas.
While here, improve error messages slighly.
 1.7  19-Feb-2001  jdolecek resurrect old ftmp() - it supports alternative directory for temporary
file, which is needed for -T support
 1.6  08-Jan-2001  jdolecek make ftmp() wrapper aroung tmpfile(), there is no need to reimplement it
move ftmp() from tmp.c to files.c
g/c no longer needed stuff
 1.5  16-Oct-2000  jdolecek include a bit more information in error messages
 1.4  11-Oct-2000  thorpej Format string fixes.
 1.3  07-Oct-2000  bjh21 Two classes of changes from the initial OpenBSD commit of this sort(1):
FILE * variables are called "fp" rather than "fd".
Better (safer) temporary-file handling.
 1.2  07-Oct-2000  bjh21 Hit sort(1) with a hammer till it compiles.
Also add RCSIDs.
 1.1  07-Oct-2000  bjh21 branches: 1.1.1;
Initial revision
 1.1.1.1  07-Oct-2000  bjh21 4.4BSD-Lite2 contrib/sort
 1.12.10.1  18-May-2008  yamt sync with head.
 1.13.12.1  21-Apr-2010  matt sync to netbsd-5
 1.13.6.1  14-Oct-2009  sborrill Pull up the following revisions(s) (requested by dsl in ticket #1084):
usr.bin/sort/Makefile: revision 1.6-1.8
usr.bin/sort/append.c: revision 1.15-1.22
usr.bin/sort/fields.c: revision 1.20-1.30
usr.bin/sort/files.c: revision 1.27-1.40
usr.bin/sort/fsort.c: revision 1.33-1.45
usr.bin/sort/fsort.h: revision 1.14-1.17
usr.bin/sort/init.c: revision 1.19-1.23
usr.bin/sort/msort.c: revision 1.19-1.28
usr.bin/sort/radix_sort.c: revision 1.1-1.4
usr.bin/sort/sort.1: revision 1.27-1.29
usr.bin/sort/sort.c: revision 1.47-1.56
usr.bin/sort/sort.h: revision 1.20-1.30
usr.bin/sort/tmp.c: revision 1.14-1.15

Only use radix sort for in-memory sort, always merge temporary files.
Use a local radixsort() function so we can pass record length.
Avoid use of weight tables for key compares.
Fix generation of keys for numbers, negate value for reverse sort.
Write file in reverse-key order for 'sort -n'.
'sort -S' now does a posix sort (sort matching keys by record data).
Ensure merge sort doesn't have too many temporary files open.
Fixes: PR#18614 PR#27257 PR#25551 PR#22182 PR#31095 PR#30504 PR#36816
PR#37860 PR#39308 PR#42094

RSS XML Feed