Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Nov 2003 20:18:05 +0100
From:      Dimitry Andric <dimitry@andric.com>
To:        Wiktor Niesiobedzki <bsd@w.evip.pl>
Cc:        current@freebsd.org
Subject:   Re: munmap & cp
Message-ID:  <5342692438.20031112201805@andric.com>
In-Reply-To: <20031111143115.GB231@mail.evip.pl>
References:  <20031111143115.GB231@mail.evip.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
------------A31B53A2E7CC484
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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...

------------A31B53A2E7CC484
Content-Type: application/pgp-signature

-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.2.3 (MingW32)

iD8DBQE/sodtsF6jCi4glqMRAm46AJsEAspVUxjvTx2/v1WdbWyDYF0WAgCdGmeF
7IkmYMLHkZe3ihaqUcw4Zps=
=5mbV
-----END PGP MESSAGE-----

------------A31B53A2E7CC484--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5342692438.20031112201805>