github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/openbsd/mm.txt (about)

     1  # Copyright 2017 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  include <sys/types.h>
     5  include <sys/mman.h>
     6  
     7  mmap(addr vma, len len[addr], prot flags[mmap_prot], flags flags[mmap_flags], fd fd, offset fileoff)
     8  munmap(addr vma, len len[addr])
     9  mprotect(addr vma, len len[addr], prot flags[mmap_prot])
    10  madvise(addr vma, len len[addr], advice flags[madvise_flags])
    11  mlock(addr vma, size len[addr])
    12  munlock(addr vma, size len[addr])
    13  mlockall(flags flags[mlockall_flags])
    14  munlockall()
    15  minherit(addr vma, len len[addr], inherit flags[inherit_flags])
    16  msync(addr vma, len len[addr], flags flags[msync_flags])
    17  mquery(addr vma, len len[addr], prot flags[mmap_prot], flags flags[mquery_flags], fd fd, offset fileoff)
    18  
    19  mmap_prot = PROT_EXEC, PROT_READ, PROT_WRITE, PROT_NONE
    20  mmap_flags = MAP_SHARED, MAP_PRIVATE, MAP_FIXED, MAP_ANONYMOUS, MAP_STACK, __MAP_NOFAULT, __MAP_NOREPLACE
    21  madvise_flags = MADV_NORMAL, MADV_RANDOM, MADV_SEQUENTIAL, MADV_WILLNEED, MADV_DONTNEED, MADV_SPACEAVAIL, MADV_FREE
    22  mlockall_flags = MCL_CURRENT, MCL_FUTURE
    23  inherit_flags = MAP_INHERIT_NONE, MAP_INHERIT_COPY, MAP_INHERIT_SHARE, MAP_INHERIT_ZERO
    24  msync_flags = MS_ASYNC, MS_SYNC, MS_INVALIDATE
    25  mquery_flags = MAP_FIXED