Commit Graph

18 Commits

Author SHA1 Message Date
enami fa07a48b77 Don't put a space before function call operator. 2005-04-11 10:39:06 +00:00
enami e61e3e0913 byte offset and line count shouldn't be initialized inside the loop. 2005-04-11 09:41:02 +00:00
enami 168f415563 Fix indent and wrap long lines. 2005-04-11 09:40:15 +00:00
dsl 48a0480288 Initialise dfound outside loop so that 0 sized files compare correctly
and to that 'cmp -l' will exit with error is the last block matches.
Pointed out in a private mail bt someone who wishes to remain anonymous.
2005-03-07 07:51:42 +00:00
dsl afc59ef61f mmap normal files in 1MB chunks.
Due to a bug in mmap() the address space isn't counted against ulimit
until the page is faulted in - so mmapping a large file suceeds, but
cmp SIGSEGVs when it runs out of address space.
Also I don't believe that the madvise( MAP_SEQUENTIAL) has the desired
effect, and mmaping a large file is probably very bad for the UBC.
2005-02-06 21:19:46 +00:00
dsl 6ffe77ddd2 Taking (out) the __P 2005-02-06 20:50:34 +00:00
agc 89aaa1bb64 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00
lukem c2b84904ae use %ll_ instead of the less standard %q_ 2001-01-04 23:05:54 +00:00
mycroft 2dc192ae06 Use MAP_SHARED. 2000-07-27 02:58:57 +00:00
jdolecek 2d6604a645 Do not mmap() with MAP_PRIVATE - looks like kernel tries to preallocate
some memory in case the mmapped contents would be changed and this fails
for very large files; it's unnecessary anyway, cmp(1) does not change file
contents in any way.
This fixes bin/10625 by Uwe Klaus.

While here, change the code to fallback to classic stdio if mmap fails.
2000-07-18 10:23:43 +00:00
kleink 0848e8913a * Hint MADV_SEQUENTIAL.
* -1 -> MAP_FAILED.
2000-03-20 18:23:26 +00:00
ross f670fa10c5 Add { and } to shut up egcs. Reformat the more questionable code. 1998-08-25 20:59:36 +00:00
mrg 25b87a361a use MAP_PRIVATE|MAP_FILE rather than "0" 1997-12-09 10:59:54 +00:00
mrg 66f7b9fd72 fix compile warnings on the alpha. 1997-10-19 14:05:56 +00:00
lukem 18ce25404d WARNSify, fix .Nm usage 1997-10-18 12:52:04 +00:00
tls 9d225a1783 RCS ID police 1997-01-09 20:18:21 +00:00
tls 94f6fc8e46 Sync with 4.4lite2 1995-09-08 03:22:54 +00:00
tls 46ef75ac74 imported from 44lite2 1995-09-04 21:07:24 +00:00