Searched refs:mem_fd (Results 1 – 4 of 4) sorted by relevance
/linux/tools/testing/selftests/mm/ |
H A D | uffd-common.c | 26 int mem_fd; in uffd_mem_fd_create() local 30 mem_fd = memfd_create("uffd-test", memfd_flags); in uffd_mem_fd_create() 31 if (mem_fd < 0) in uffd_mem_fd_create() 33 if (ftruncate(mem_fd, mem_size)) in uffd_mem_fd_create() 35 if (fallocate(mem_fd, in uffd_mem_fd_create() 40 return mem_fd; in uffd_mem_fd_create() 81 int mem_fd = uffd_mem_fd_create(size * 2, true); in hugetlb_allocate_area() local 86 mem_fd, offset); in hugetlb_allocate_area() 94 MAP_SHARED, mem_fd, offset); in hugetlb_allocate_area() 107 close(mem_fd); in hugetlb_allocate_area() [all …]
|
H A D | mkdirty.c | 30 static int mem_fd; variable 110 lseek(mem_fd, (uintptr_t) mem, SEEK_SET); in test_ptrace_write() 111 ret = write(mem_fd, &data, 1); in test_ptrace_write() 140 lseek(mem_fd, (uintptr_t) mem, SEEK_SET); in test_ptrace_write_thp() 141 ret = write(mem_fd, &data, 1); in test_ptrace_write_thp() 341 mem_fd = open("/proc/self/mem", O_RDWR); in main() 342 if (mem_fd < 0) in main()
|
H A D | mremap_dontunmap.c | 133 int mem_fd = memfd_create("memfd", MFD_CLOEXEC); in mremap_dontunmap_simple_shmem() local 134 BUG_ON(mem_fd < 0, "memfd_create"); in mremap_dontunmap_simple_shmem() 136 BUG_ON(ftruncate(mem_fd, num_pages * page_size) < 0, in mremap_dontunmap_simple_shmem() 141 MAP_FILE | MAP_SHARED, mem_fd, 0); in mremap_dontunmap_simple_shmem() 144 BUG_ON(close(mem_fd) < 0, "close"); in mremap_dontunmap_simple_shmem()
|
H A D | ksm_functional_tests.c | 40 static int mem_fd; variable 638 lseek(mem_fd, (uintptr_t) map + i, SEEK_SET); in test_prot_none() 639 if (write(mem_fd, &i, sizeof(i)) != sizeof(i)) { in test_prot_none() 659 mem_fd = open("/proc/self/mem", O_RDWR); in init_global_file_handles() 660 if (mem_fd < 0) in init_global_file_handles()
|