Bug 18589 - cmp(1) chokes on large files
Summary: cmp(1) chokes on large files
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Mike Heffner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-05-16 09:40 UTC by Poul-Henning Kamp
Modified: 2001-11-04 21:38 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Poul-Henning Kamp freebsd_committer freebsd_triage 2000-05-16 09:40:03 UTC
The cmp(1) program mmaps the files to be compared.  This fails for large files.

Fix: 

Add a loop around the mmap/compare operation which operates on some moderate amount of data each iteration.
How-To-Repeat: cmp -l file.1 file.2  where the two files are 3242115072 bytes long
Comment 1 Mike Heffner freebsd_committer freebsd_triage 2001-06-16 21:07:11 UTC
Responsible Changed
From-To: freebsd-bugs->mikeh

Add another one to the todo list. I'm working on some patches for 
this anyways.
Comment 2 dwmalone freebsd_committer freebsd_triage 2001-11-04 21:34:47 UTC
State Changed
From-To: open->closed

Closed in favour of PR 24732, which has patches which have been committed 
to -current.