sysdeps/sigma: Implement non-fixed mmap

This commit is contained in:
Thomas Woertman 2019-11-17 17:24:58 +01:00
parent 48e8583bfd
commit 22a1f84bf6
No known key found for this signature in database
GPG key ID: BC9D555359629FE0
2 changed files with 14 additions and 14 deletions

View file

@ -17,14 +17,14 @@ namespace mlibc {
// Memory Related Functions
int sys_vm_map(void *hint, size_t size, int prot, int flags, int fd, off_t offset, void **window){
if(!(flags & MAP_ANONYMOUS) || !(flags | MAP_FIXED))
__ensure(!"Anything else than MAP_ANONYMOUS | MAP_FIXED is unimplemented");
if(!(flags & MAP_ANONYMOUS))
__ensure(!"MAP_ANONYMOUS must be set, fd based mmaps are unimplemented");
int ret = libsigma_vm_map(size, hint, prot, flags);
*window = hint;
if(ret == 0)
return 0;
return ENOMEM;
void* ret = libsigma_vm_map(size, hint, prot, flags);
if(!ret)
return ENOMEM;
*window = ret;
return 0;
}
/*#ifndef MLIBC_BUILDING_RTDL

View file

@ -99,14 +99,14 @@ int sys_close(int fd){
}
int sys_vm_map(void *hint, size_t size, int prot, int flags, int fd, off_t offset, void **window){
if(!(flags & MAP_ANONYMOUS) || !(flags | MAP_FIXED))
__ensure(!"Anything else than MAP_ANONYMOUS | MAP_FIXED is unimplemented");
if(!(flags & MAP_ANONYMOUS))
__ensure(!"MAP_ANONYMOUS must be set, fd based mmaps are unimplemented");
int ret = libsigma_vm_map(size, hint, prot, flags);
*window = hint;
if(ret == 0)
return 0;
return ENOMEM;
void* ret = libsigma_vm_map(size, hint, prot, flags);
if(!ret)
return ENOMEM;
*window = ret;
return 0;
} // namespace mlibc
}