syzkaller/sys/netbsd/mm.txt
Dmitry Vyukov ecb386fe6f sys: check that target consts are defined
Currently when we get target consts with target.ConstMap["name"]
during target initialization, we just get 0 for missing consts.
This is error-prone as we can mis-type a const, or a const may
be undefined only on some archs (as we have common unix code
shared between several OSes).
Check that all the consts are actually defined.
The check detects several violations, to fix them:
1. move mremap to linux as it's only defined on linux
2. move S_IFMT to openbsd, as it's only defined and used on openbsd
3. define missing MAP_ANONYMOUS for freebsd and netbsd
4. fix extract for netbsd
2018-10-19 19:11:22 +01:00

22 lines
942 B
Plaintext

# Copyright 2017 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
include <sys/types.h>
include <sys/mman.h>
mmap(addr vma, len len[addr], prot flags[mmap_prot], flags flags[mmap_flags], fd fd, pad const[0], offset fileoff)
munmap(addr vma, len len[addr])
mprotect(addr vma, len len[addr], prot flags[mmap_prot])
madvise(addr vma, len len[addr], advice flags[madvise_flags])
mlock(addr vma, size len[addr])
munlock(addr vma, size len[addr])
mlockall(flags flags[mlockall_flags])
munlockall()
mmap_prot = PROT_EXEC, PROT_READ, PROT_WRITE, PROT_NONE
mmap_flags = MAP_ANON, MAP_FILE, MAP_FIXED, MAP_HASSEMAPHORE, MAP_INHERIT, MAP_TRYFIXED, MAP_WIRED, MAP_PRIVATE, MAP_SHARED
madvise_flags = MADV_NORMAL, MADV_RANDOM, MADV_SEQUENTIAL, MADV_WILLNEED, MADV_DONTNEED, MADV_FREE
mlockall_flags = MCL_CURRENT, MCL_FUTURE
define MAP_ANONYMOUS MAP_ANON