svn commit: r196558 - head/usr.bin/look

John Baldwin jhb at
Wed Aug 26 13:32:09 UTC 2009

On Tuesday 25 August 2009 11:30:06 pm Colin Percival wrote:
> Author: cperciva
> Date: Wed Aug 26 03:30:06 2009
> New Revision: 196558
> URL:
> Log:
>   Don't try to mmap the contents of empty files.  This behaviour was harmless
>   prior to r195693, since historical behaviour of mmap(2) was to silently
>   ignore length-zero mmap requests; but mmap now returns EINVAL, which caused
>   look(1) to emit an error message and fail.

FWIW, it did not silently ignore the request.  Instead it rounded the size up
to a page and mapped a page of data.  However, if you then passed that pointer
with a length of 0 to munmap() munmap() would fail.

John Baldwin

More information about the svn-src-all mailing list