llvm/libc/src/sys/mman/linux/CMakeLists.txt

add_entrypoint_object(
  madvise
  SRCS
    madvise.cpp
  HDRS
    ../madvise.h
  DEPENDS
    libc.include.sys_mman
    libc.include.sys_syscall
    libc.src.__support.OSUtil.osutil
    libc.src.errno.errno
)

add_entrypoint_object(
  mmap
  SRCS
    mmap.cpp
  HDRS
    ../mmap.h
  DEPENDS
    libc.include.sys_mman
    libc.include.sys_syscall
    libc.src.__support.OSUtil.osutil
    libc.src.errno.errno
)

add_entrypoint_object(
  munmap
  SRCS
    munmap.cpp
  HDRS
    ../munmap.h
  DEPENDS
    libc.include.sys_mman
    libc.include.sys_syscall
    libc.src.__support.OSUtil.osutil
    libc.src.errno.errno
)

add_entrypoint_object(
  mprotect
  SRCS
    mprotect.cpp
  HDRS
    ../mprotect.h
  DEPENDS
    libc.include.sys_mman
    libc.include.sys_syscall
    libc.src.__support.OSUtil.osutil
    libc.src.errno.errno
)

add_entrypoint_object(
  posix_madvise
  SRCS
    posix_madvise.cpp
  HDRS
    ../posix_madvise.h
  DEPENDS
    libc.include.sys_mman
    libc.include.sys_syscall
    libc.src.__support.OSUtil.osutil
)

add_entrypoint_object(
  mincore
  SRCS
    mincore.cpp
  HDRS
    ../mincore.h
  DEPENDS
    libc.include.sys_mman
    libc.include.sys_syscall
    libc.src.__support.OSUtil.osutil
    libc.src.errno.errno
)

add_entrypoint_object(
  mlock
  SRCS
    mlock.cpp
  HDRS
    ../mlock.h
  DEPENDS
    libc.include.sys_mman
    libc.include.sys_syscall
    libc.src.__support.OSUtil.osutil
    libc.src.errno.errno
)

add_entrypoint_object(
  mlock2
  SRCS
    mlock2.cpp
  HDRS
    ../mlock2.h
  DEPENDS
    libc.include.sys_mman
    libc.include.sys_syscall
    libc.src.__support.OSUtil.osutil
    libc.src.errno.errno
)

add_entrypoint_object(
  munlock
  SRCS
    munlock.cpp
  HDRS
    ../munlock.h
  DEPENDS
    libc.include.sys_mman
    libc.include.sys_syscall
    libc.src.__support.OSUtil.osutil
    libc.src.errno.errno
)

add_entrypoint_object(
  mlockall
  SRCS
    mlockall.cpp
  HDRS
    ../mlockall.h
  DEPENDS
    libc.include.sys_mman
    libc.include.sys_syscall
    libc.src.__support.OSUtil.osutil
    libc.src.errno.errno
)

add_entrypoint_object(
  munlockall
  SRCS
    munlockall.cpp
  HDRS
    ../munlockall.h
  DEPENDS
    libc.include.sys_mman
    libc.include.sys_syscall
    libc.src.__support.OSUtil.osutil
    libc.src.errno.errno
)

add_entrypoint_object(
  msync
  SRCS
    msync.cpp
  HDRS
    ../msync.h
  DEPENDS
    libc.include.sys_mman
    libc.include.sys_syscall
    libc.src.__support.OSUtil.osutil
    libc.src.errno.errno
)

add_header_library(
  shm_common
  HDRS
    shm_common.h
  DEPENDS
    libc.src.__support.CPP.array
    libc.src.__support.CPP.string_view
    libc.src.__support.CPP.optional
    libc.src.__support.common
    libc.src.errno.errno
    libc.src.string.memory_utils.inline_memcpy
)

add_entrypoint_object(
  shm_open
  SRCS
    shm_open.cpp
  HDRS
    ../shm_open.h
  DEPENDS
    libc.src.fcntl.open
    libc.include.llvm-libc-macros.fcntl_macros
    libc.include.llvm-libc-types.mode_t
    .shm_common
)

add_entrypoint_object(
  shm_unlink
  SRCS
    shm_unlink.cpp
  HDRS
    ../shm_unlink.h
  DEPENDS
    libc.src.unistd.unlink
    .shm_common
)