user/lib/libsystem/src/sys/vm.c
/**
 * Creates a new virtual memory mapping backed by anonymous memory.
 */
Creates a new virtual memory mapping backed by anonymous memory.
Creates a new virtual memory mapping backed by anonymous memory .
int AllocVirtualAnonRegion(const uintptr_t size, const uintptr_t inFlags, uintptr_t *outHandle) {
    intptr_t err;
    if(!outHandle) return -1;
    uintptr_t flags = 0;
    flags = BuildSyscallFlags(inFlags, true);
    err = __do_syscall2(size, flags, SYS_VM_CREATE_ANON);
    if(err > 0) {
        *outHandle = err;
    }
    return (err < 0) ? err : 0;
}
int AllocVirtualAnonRegion ( const uintptr_t size , const uintptr_t inFlags , uintptr_t * outHandle ) { intptr_t err ; if ( ! outHandle ) return -1 ; uintptr_t flags = 0 ; flags = BuildSyscallFlags ( inFlags , true ) ; err = __do_syscall2 ( size , flags , SYS_VM_CREATE_ANON ) ; if ( err > 0 ) { * outHandle = err ; } return ( err < 0 ) ? err : 0 ; }
Creates a new virtual memory mapping backed by anonymous memory.
Creates a new virtual memory mapping backed by anonymous memory .
// build flags // perform syscall // return 0 for success, syscall error otherwise