mmap call to filesystem
mmap call to filesystem
- Subject: mmap call to filesystem
- From: "shailesh jain" <email@hidden>
- Date: Sat, 28 Jun 2008 17:09:50 -0700
Hi,
I have couple of questions regarding mmap call.
1) It seems that OS X just discards any error code from the file system, when mmap call is made.
In ubc_map it seems that EPERM error code is respected by OS X. However, I looked at all the places from where ubc_map() call is made namely {kern_exec, mach_loader, mmap} and I found that the error code is not handled.
ubc_map()
{
........
1286 error = VNOP_MMAP(vp, flags, vfs_context_current());
1287
1288 if (error != EPERM)
1289 error = 0;
......
}
2) Also, I wanted to know about the option MAP_PRIVATE passed to the mmap call. When, this option
is passed, the modifications to the data are just made in-memory and are not reflected to the actual object. Now, If PROT_WRITE option is passed to the filesystem and the file is just opened for reading,
should the call fail ? Shouldn't it depend upon options {MAP_PRIVATE or MAP_SHARED } which are not passed to the filesystem ?
Also, I was looking at the mmap implementation but couldn't figure out how MAP_PRIVATE option was handled by kernel.
int
osmap()
{
......
if ((uap->share == MAP_SHARED )|| (uap->share == MAP_PRIVATE )) {
......
ret = mmap(curp, &newargs, &addr);
}
}
mmap() {
// No handling of MAP_PRIVATE
}
/Shail
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden