1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-02 08:42:48 +00:00

Explicitly specify MAP_SHARED when mapping the stats file descriptor.

Reviewed by:	kib
MFC after:	1 week
This commit is contained in:
John Baldwin 2014-09-17 19:37:58 +00:00
parent 5e93a4b46b
commit 2c2cd2c14c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271721

View File

@ -68,7 +68,7 @@ geom_stats_resync(void)
return;
for (;;) {
p = mmap(statp, (npages + 1) * pagesize,
PROT_READ, 0, statsfd, 0);
PROT_READ, MAP_SHARED, statsfd, 0);
if (p == MAP_FAILED)
break;
else
@ -90,7 +90,7 @@ geom_stats_open(void)
return (errno);
pagesize = getpagesize();
spp = pagesize / sizeof(struct devstat);
p = mmap(NULL, pagesize, PROT_READ, 0, statsfd, 0);
p = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, statsfd, 0);
if (p == MAP_FAILED) {
error = errno;
close(statsfd);