Re: munmap & cp

From: Dimitry Andric <dimitry_at_andric.com>
Date: Wed, 12 Nov 2003 20:18:05 +0100
On 2003-11-11 at 15:31:15 Wiktor Niesiobedzki wrote:

> $ mkdir foo
> $ cd foo
> $ touch foo
> $ cp foo foo2
> cp: foo: Invalid argument

Yes, I've just run into this problem too, because a large number of
ports failed to install because of it. This is because they cp -r a
number of directories to be installed, and these obviously contain 0
byte files... :(

Since the cp source doesn't seem to have been touched for 4 months, it
turns out that the semantics of the munmap call changed suddenly, due
to "Open Group Base Specifications Issue 6", see:

http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/vm/vm_map.c

I wonder why mmap of 0 bytes is allowed to succeed, and munmap of the
same amount is not, but then again, it's obviously following a
standard, which doesn't have to abide to any rules of logic. ;)

Anyway, cp (and possibly other tools which use munmap) will need to be
fixed. For now, I simply disabled the VM_AND_BUFFER_CACHE_SYNCHRONIZED
flag in the Makefile for cp, which simply disables the whole mmap'ing
stuff. I don't notice any difference without it...

Received on Wed Nov 12 2003 - 10:18:21 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:28 UTC