treat memory devices as regular files,

to enable processes to mmap() /dev/zero
This commit is contained in:
NAKAMURA Gou
2016-03-18 15:52:58 +09:00
parent 86ac51157c
commit d6c51ff997

View File

@ -902,7 +902,10 @@ static int pager_req_create(ihk_os_t os, int fd, uintptr_t result_pa)
dprintk("pager_req_create(%d,%lx):vfs_stat failed. %d\n", fd, (long)result_pa, error);
goto out;
}
if (!S_ISREG(st.mode)) {
if (S_ISCHR(st.mode) && (MAJOR(st.rdev) == 1)) {
/* treat memory devices as regular files */
}
else if (!S_ISREG(st.mode)) {
error = -ESRCH;
dprintk("pager_req_create(%d,%lx):not VREG. %x\n", fd, (long)result_pa, st.mode);
goto out;