]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Don't use mmap() for non-regular files, since st_size is only meaningful
authorBruce Evans <bde@FreeBSD.org>
Wed, 18 Nov 1998 11:47:45 +0000 (11:47 +0000)
committerBruce Evans <bde@FreeBSD.org>
Wed, 18 Nov 1998 11:47:45 +0000 (11:47 +0000)
commit40fc4ee2decdfdd7fe4d748b8cac2063d510f2d0
tree7e2ef848a7d9a1f6a3a7d9c7c7cd1bac1663064d
parent4f699173cb6857c91138afda709896a50200f434
Don't use mmap() for non-regular files, since st_size is only meaningful
for regular files.  This fixes recent breakage of cp'ing from /dev/zero.
/dev/zero doesn't support mmap(), but the device driver mmap routines are
not called for mapping 0 bytes, so the error was not detected.  mmap()
can't even be used for cp'ing special files that support mmap(), since
there is general way to determine the file size.
bin/cp/utils.c