return 0;
}
+int
+mem_remap(void** addr_out,
+ struct mm_region** remapped,
+ void* addr,
+ struct v_file* file,
+ struct mmap_param* param)
+{
+}
+
void
mem_sync_pages(ptr_t mnt,
struct mm_region* region,
if (!addr) {
addr = UMMAP_START;
} else if (addr < UMMAP_START || addr + length >= UMMAP_END) {
- errno = ENOMEM;
- goto done;
- }
-
- struct v_fd* vfd;
- if ((errno = vfs_getfd(fd, &vfd))) {
- goto done;
+ if (!(options & (MAP_FIXED | MAP_FIXED_NOREPLACE))) {
+ errno = ENOMEM;
+ goto done;
+ }
}
- struct v_file* file = vfd->file;
+ struct v_file* file = NULL;
if (!(options & MAP_ANON)) {
+ struct v_fd* vfd;
+ if ((errno = vfs_getfd(fd, &vfd))) {
+ goto done;
+ }
+
+ file = vfd->file;
if (!file->ops->read_page) {
errno = ENODEV;
goto done;
}
- } else {
- file = NULL;
}
struct mmap_param param = { .flags = options,