llvm/libc/test/src/sys/mman/linux/mlock_test.cpp

//===-- Unittests for mlock -----------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/errno/libc_errno.h"
#include "src/sys/mman/madvise.h"
#include "src/sys/mman/mincore.h"
#include "src/sys/mman/mlock.h"
#include "src/sys/mman/mlock2.h"
#include "src/sys/mman/mlockall.h"
#include "src/sys/mman/mmap.h"
#include "src/sys/mman/munlock.h"
#include "src/sys/mman/munlockall.h"
#include "src/sys/mman/munmap.h"
#include "src/sys/resource/getrlimit.h"
#include "src/unistd/sysconf.h"
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/LibcTest.h"
#include "test/UnitTest/Test.h"

#include <asm-generic/errno-base.h>
#include <asm-generic/mman.h>
#include <linux/capability.h>
#include <sys/mman.h>
#include <sys/resource.h>
#include <sys/syscall.h>
#include <unistd.h>

usingnamespaceLIBC_NAMESPACE::testing::ErrnoSetterMatcher;

struct PageHolder {};

static bool get_capacity(unsigned int cap) {}

static bool is_permitted_size(size_t size) {}

TEST(LlvmLibcMlockTest, UnMappedMemory) {}

TEST(LlvmLibcMlockTest, Overflow) {}

#ifdef SYS_mlock2
TEST(LlvmLibcMlockTest, MLock2) {}
#endif

TEST(LlvmLibcMlockTest, InvalidFlag) {}

TEST(LlvmLibcMlockTest, MLockAll) {}