/tools/testing/selftests/landlock/ |
D | base_test.c | 183 open("/tmp", O_PATH | O_NOFOLLOW | O_DIRECTORY | O_CLOEXEC); in TEST() 206 open("/tmp", O_PATH | O_NOFOLLOW | O_DIRECTORY | O_CLOEXEC); in TEST() 278 open("/tmp", O_PATH | O_NOFOLLOW | O_DIRECTORY | O_CLOEXEC); in TEST() 306 ASSERT_EQ(-1, open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC)); in TEST() 308 dir_fd = open("/tmp", O_RDONLY | O_DIRECTORY | O_CLOEXEC); in TEST() 318 dir_fd = open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC); in TEST() 321 dir_fd = open("/tmp", O_RDONLY | O_DIRECTORY | O_CLOEXEC); in TEST() 341 dir_fd = open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC); in TEST() 354 EXPECT_EQ(-1, open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC)); in TEST() 368 EXPECT_EQ(-1, open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC)); in TEST() [all …]
|
D | ptrace_test.c | 57 fd = open(procenv_path, O_RDONLY | O_CLOEXEC); in test_ptrace_read() 313 ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC)); in TEST_F() 314 ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC)); in TEST_F()
|
D | fs_test.c | 388 fd = openat(dirfd, path, flags | O_CLOEXEC); in test_open_rel() 442 open(dir_s1d2, O_PATH | O_DIRECTORY | O_CLOEXEC); in TEST_F_FORK() 445 ruleset_fd = open(dir_s1d1, O_PATH | O_DIRECTORY | O_CLOEXEC); in TEST_F_FORK() 453 ruleset_fd = open(dir_s1d1, O_DIRECTORY | O_CLOEXEC); in TEST_F_FORK() 470 path_beneath.parent_fd = open(dir_s1d2, O_DIRECTORY | O_CLOEXEC); in TEST_F_FORK() 484 open(dir_s1d2, O_PATH | O_DIRECTORY | O_CLOEXEC); in TEST_F_FORK() 565 path_beneath_file.parent_fd = open(file1_s1d2, O_PATH | O_CLOEXEC); in TEST_F_FORK() 570 open(dir_s1d2, O_PATH | O_DIRECTORY | O_CLOEXEC); in TEST_F_FORK() 618 path_beneath.parent_fd = open(path, O_PATH | O_CLOEXEC); in add_path_beneath() 733 path_beneath.parent_fd = open("/proc/self/ns/mnt", O_PATH | O_CLOEXEC); in TEST_F_FORK() [all …]
|
/tools/perf/util/ |
D | util.h | 66 #ifndef O_CLOEXEC 68 #define O_CLOEXEC 0x400000 macro 70 #define O_CLOEXEC 010000000 macro 72 #define O_CLOEXEC 02000000 macro
|
/tools/testing/selftests/filesystems/fuse/ |
D | fuse_test.c | 82 O_WRONLY | O_TRUNC | O_CLOEXEC), tp != -1); in bpf_clear_trace() 98 O_RDONLY | O_CLOEXEC), in bpf_test_trace_maybe() 152 TESTERR(fd = open(filename, O_RDONLY | O_CLOEXEC), fd != -1); in basic_test() 213 TEST(src_fd = open(ft_src, O_DIRECTORY | O_RDONLY | O_CLOEXEC), in bpf_test_real() 215 TEST(fd = openat(src_fd, test_name, O_CREAT | O_RDWR | O_CLOEXEC, 0777), in bpf_test_real() 226 TESTERR(fd = open(filename, O_RDONLY | O_CLOEXEC), fd != -1); in bpf_test_real() 255 TEST(src_fd = open(ft_src, O_DIRECTORY | O_RDONLY | O_CLOEXEC), in bpf_test_partial() 268 TESTERR(fd = open(filename, O_RDONLY | O_CLOEXEC), fd != -1); in bpf_test_partial() 318 TEST(src_fd = open(ft_src, O_DIRECTORY | O_RDONLY | O_CLOEXEC), in bpf_test_attrs() 362 TEST(src_fd = open(ft_src, O_DIRECTORY | O_RDONLY | O_CLOEXEC), in bpf_test_readdir() [all …]
|
D | fuse_daemon.c | 43 O_RDONLY | O_CLOEXEC), tp != -1); in display_trace() 222 TEST(src_fd = open("fd-src", O_DIRECTORY | O_RDONLY | O_CLOEXEC), in main()
|
D | bpf_loader.c | 273 res = open(pathname.s, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, mode); in s_creat() 481 O_WRONLY | O_CLOEXEC), in tracing_on() 569 TEST(fuse_dev = open("/dev/fuse", O_RDWR | O_CLOEXEC), fuse_dev != -1); in mount_fuse_maybe_init() 734 TEST(filter_fd = open(path, O_RDONLY | O_CLOEXEC), filter_fd != -1); in install_elf_bpf() 788 O_RDONLY | O_CLOEXEC), in install_elf_bpf()
|
/tools/testing/selftests/filesystems/incfs/ |
D | incfs_stress.c | 110 O_RDONLY | O_CLOEXEC); in reader() 135 int fd = openat(dir_fd, name, O_RDWR | O_CLOEXEC); in write_data() 187 O_RDONLY | O_CLOEXEC); in test_files() 302 src_dir_fd = open(src_dir, O_RDONLY | O_CLOEXEC); in main() 303 dst_dir_fd = open(dst_dir, O_RDONLY | O_CLOEXEC); in main()
|
D | incfs_perf.c | 188 int fd = openat(dir_fd, name, O_RDWR | O_CLOEXEC); in write_data() 320 fd = openat(dir, name, O_RDONLY | O_CLOEXEC); in measure_read_throughput_internal() 398 fd = openat(dir, name, O_CREAT | O_WRONLY | O_CLOEXEC, 0600); in test_native_file() 520 fd = openat(dir, name, O_RDONLY | O_CLOEXEC); in load_hash_tree() 548 O_RDONLY | O_CLOEXEC); in test_incfs_file() 680 native_dir_fd = open(native_dir, O_RDONLY | O_CLOEXEC); in main() 681 src_dir_fd = open(src_dir, O_RDONLY | O_CLOEXEC); in main() 682 dst_dir_fd = open(dst_dir, O_RDONLY | O_CLOEXEC); in main()
|
D | utils.c | 53 open("/proc/sys/vm/drop_caches", O_WRONLY | O_CLOEXEC); in drop_caches() 241 cmd_fd = open(cmd_file, O_RDONLY | O_CLOEXEC); in open_commands_file() 254 fd = open(file, O_RDWR | O_CLOEXEC); in open_log_file() 267 fd = open(file, O_RDONLY | O_CLOEXEC); in open_blocks_written_file()
|
D | incfs_test.c | 325 int fd = open(path, O_RDWR | O_CLOEXEC); in open_file_by_id() 583 fd = open(filename, O_RDONLY | O_CLOEXEC); in read_whole_file() 615 fd = open(filename, O_RDONLY | O_CLOEXEC); in read_test_file() 1111 int fd = open(dir_to_iterate, O_RDONLY | O_DIRECTORY | O_CLOEXEC); in iterate_directory() 1312 fd = open(path, O_RDWR | O_CLOEXEC); in basic_file_ops_test() 2020 TEST(fd = open(filename, O_RDONLY | O_CLOEXEC), fd != -1); in validate_hash_tree() 2189 TEST(fd = open(filename, O_RDONLY | O_CLOEXEC), fd != -1); in validate_logs() 2461 fd = open(filename, O_RDONLY | O_CLOEXEC); in validate_ranges() 2697 fd = open(filename, O_RDONLY | O_CLOEXEC); in validate_hash_ranges() 2898 fd = open(name, O_RDONLY | O_CLOEXEC); in validate_mapped_file() [all …]
|
/tools/include/uapi/asm-generic/ |
D | fcntl.h | 62 #ifndef O_CLOEXEC 63 #define O_CLOEXEC 02000000 /* set close_on_exec */ macro
|
/tools/testing/selftests/filesystems/binderfs/ |
D | binderfs_test.c | 91 fd = open(device_path, O_RDONLY | O_CLOEXEC); in __do_binderfs_test() 114 fd = open(device_path, O_CLOEXEC | O_RDONLY); in __do_binderfs_test() 161 fd = open(device_path, O_CLOEXEC | O_RDONLY); in __do_binderfs_test() 257 setgroups_fd = open(path, O_WRONLY | O_CLOEXEC | O_NOFOLLOW); in write_id_mapping() 282 fd = open(path, O_WRONLY | O_CLOEXEC | O_NOFOLLOW); in write_id_mapping() 432 fd = open(device_path, O_RDONLY | O_CLOEXEC); in TEST() 449 fds[i] = open(device_path, O_RDONLY | O_CLOEXEC); in TEST()
|
/tools/testing/selftests/pidfd/ |
D | pidfd_test.c | 69 pidfd = open("/proc/self", O_DIRECTORY | O_CLOEXEC); in test_pidfd_send_signal_simple_success() 116 pidfd = open(buf, O_DIRECTORY | O_CLOEXEC); in test_pidfd_send_signal_exited_fail() 220 pidfd = open(buf, O_DIRECTORY | O_CLOEXEC); in test_pidfd_send_signal_recycled_pid_fail() 249 ret = pipe2(pipe_fds, O_CLOEXEC); in test_pidfd_send_signal_recycled_pid_fail() 356 pidfd = open("/proc/self", O_DIRECTORY | O_CLOEXEC); in test_pidfd_send_signal_syscall_support()
|
D | pidfd_setns_test.c | 93 fd = open("/proc/self/ns/time_for_children", O_RDONLY | O_CLOEXEC); in switch_timens() 136 proc_fd = open("/proc/self/ns", O_DIRECTORY | O_CLOEXEC); in FIXTURE_SETUP() 144 self->nsfds[i] = openat(proc_fd, info->name, O_RDONLY | O_CLOEXEC); in FIXTURE_SETUP() 237 self->nsfds[i] = openat(proc_fd, info->name, O_RDONLY | O_CLOEXEC); in FIXTURE_SETUP() 250 self->child_nsfds1[i] = open(p, O_RDONLY | O_CLOEXEC); in FIXTURE_SETUP() 263 self->child_nsfds2[i] = open(p, O_RDONLY | O_CLOEXEC); in FIXTURE_SETUP() 311 return open(path, O_RDONLY | O_CLOEXEC); in preserve_ns()
|
D | pidfd_wait.c | 55 pidfd = open("/proc/self", O_DIRECTORY | O_RDONLY | O_CLOEXEC); in TEST() 63 pidfd = open("/dev/null", O_RDONLY | O_CLOEXEC); in TEST()
|
/tools/testing/selftests/mount_setattr/ |
D | mount_setattr_test.c | 148 #define OPEN_TREE_CLOEXEC O_CLOEXEC 176 fd = open(path, O_WRONLY | O_CLOEXEC | O_NOCTTY | O_NOFOLLOW); in write_file() 425 fd = creat(NOSYMFOLLOW_TARGET, O_RDWR | O_CLOEXEC); in FIXTURE_SETUP() 632 fd = open("/mnt/A/AA/B/b", O_RDWR | O_CLOEXEC | O_CREAT | O_EXCL, 0777); in TEST_F() 681 fd = open("/mnt/A/AA/B/b", O_RDWR | O_CLOEXEC | O_CREAT | O_EXCL, 0777); in TEST_F() 711 dfd = open("/mnt/A/AA/B", O_DIRECTORY | O_CLOEXEC); in TEST_F() 987 fd = open("/mnt/A", O_DIRECTORY | O_CLOEXEC); in TEST_F() 1115 fd = open("/dev/null", O_RDONLY | O_CLOEXEC); in TEST_F() 1144 attr.userns_fd = open("/proc/1/ns/user", O_RDONLY | O_CLOEXEC); in TEST_F() 1226 ret = open(path, O_RDONLY | O_CLOEXEC); in get_userns_fd() [all …]
|
/tools/testing/selftests/dmabuf-heaps/ |
D | dmabuf-heap.c | 128 return dmabuf_heap_alloc_fdflags(fd, len, O_RDWR | O_CLOEXEC, flags, in dmabuf_heap_alloc() 311 .fd_flags = O_RDWR | O_CLOEXEC, in dmabuf_heap_alloc_older() 343 .fd_flags = O_RDWR | O_CLOEXEC, in dmabuf_heap_alloc_newer() 424 ~(O_RDWR | O_CLOEXEC), 0, &dmabuf_fd); in test_alloc_errors()
|
/tools/testing/selftests/kvm/lib/ |
D | userfaultfd_util.c | 134 uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK); in uffd_setup_demand_paging() 151 ret = pipe2(uffd_desc->pipefds, O_CLOEXEC | O_NONBLOCK); in uffd_setup_demand_paging()
|
/tools/include/uapi/linux/ |
D | mount.h | 65 #define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */
|
/tools/testing/selftests/filesystems/ |
D | devpts_pts.c | 105 master = open(ptmx, O_RDWR | O_NOCTTY | O_CLOEXEC); in do_tiocgptpeer() 123 slave = ioctl(master, TIOCGPTPEER, O_RDWR | O_NOCTTY | O_CLOEXEC); in do_tiocgptpeer()
|
/tools/gpio/ |
D | gpio-watch.c | 35 fd = open(argv[1], O_RDWR | O_CLOEXEC); in main()
|
/tools/testing/selftests/exec/ |
D | execveat.c | 236 int dot_dfd_cloexec = open_or_die(".", O_DIRECTORY|O_RDONLY|O_CLOEXEC); in run_tests() 248 int fd_cloexec = open_or_die("execveat", O_RDONLY|O_CLOEXEC); in run_tests() 249 int fd_script_cloexec = open_or_die("script", O_RDONLY|O_CLOEXEC); in run_tests()
|
/tools/testing/selftests/mm/ |
D | uffd-common.h | 41 #define UFFD_FLAGS (O_CLOEXEC | O_NONBLOCK | UFFD_USER_MODE_ONLY)
|
D | hugepage-mremap.c | 68 uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK); in register_region_with_uffd()
|