freebsd-dev/bin/cp
Jilles Tjoelker c633f8dc04 cp: Remove fts sorting.
In an attempt to improve performance, cp reordered directories first
(although the comment says directories last). This is not effective with new
UFS layout policies.

The sorting reorders multiple arguments passed to cp, which may be
undesirable.

Additionally, the comparison function does not induce a total order. Per
POSIX, this causes undefined behaviour in qsort().

NetBSD removed the sorting in 2009.

On filesystems that return directory entries in hash/btree order, sorting by
d_fileno before statting improves performance on large directories. However,
this can only be implemented in fts(3).

PR:		53475
Reviewed by:	bde (in 2004)
MFC after:	1 week
2015-05-05 13:23:03 +00:00
..
cp.1 Add a few examples. 2013-03-15 20:12:54 +00:00
cp.c cp: Remove fts sorting. 2015-05-05 13:23:03 +00:00
extern.h Add an option to allow copying of a hierarchy while linking he regular files. 2006-08-24 20:45:38 +00:00
Makefile Make 'struct acl' larger, as required to support NFSv4 ACLs. Provide 2009-05-22 15:56:43 +00:00
utils.c cp,mv: Use futimens() instead of utimensat() if possible. 2015-03-23 17:35:05 +00:00