| /linux/tools/testing/selftests/landlock/ |
| H A D | base_test.c | 227 open("/tmp", O_PATH | O_NOFOLLOW | O_DIRECTORY | O_CLOEXEC); in TEST() 250 open("/tmp", O_PATH | O_NOFOLLOW | O_DIRECTORY | O_CLOEXEC); in TEST() 284 fd = open("/dev/null", O_RDONLY | O_CLOEXEC); in TEST() 295 fd = open("/dev/null", O_RDONLY | O_CLOEXEC); in TEST() 404 open("/tmp", O_PATH | O_NOFOLLOW | O_DIRECTORY | O_CLOEXEC); 432 ASSERT_EQ(-1, open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC)); 434 dir_fd = open("/tmp", O_RDONLY | O_DIRECTORY | O_CLOEXEC); 444 dir_fd = open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC); 447 dir_fd = open("/tmp", O_RDONLY | O_DIRECTORY | O_CLOEXEC); 467 dir_fd = open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC); [all...] |
| H A D | scoped_signal_test.c | 91 ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC)); in TEST_F() 188 ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC)); in TEST_F() 189 ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC)); in TEST_F() 277 ASSERT_EQ(0, pipe2(thread_pipe, O_CLOEXEC)); in TEST() 302 ASSERT_EQ(0, pipe2(thread_pipe, O_CLOEXEC)); 354 ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC)); in FIXTURE_VARIANT_ADD() 468 ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC)); in TEST_F() 469 ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC)); in TEST_F()
|
| H A D | scoped_abstract_unix_test.c | 88 ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC)); in TEST_F() 185 ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC)); in TEST_F() 186 ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC)); in TEST_F() 317 ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC)); in TEST_F() 318 ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC)); in TEST_F() 427 ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC)); in TEST_F() 442 ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC)); in TEST_F() 646 ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC)); in FIXTURE_VARIANT_ADD() 647 ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC)); 817 ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC)); in TEST_F() [all...] |
| H A 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() 504 ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC)); 505 ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC));
|
| H A D | fs_test.c | 435 fd = openat(dirfd, path, flags | O_CLOEXEC); in test_open_rel() 489 open(dir_s1d2, O_PATH | O_DIRECTORY | O_CLOEXEC); in TEST_F_FORK() 492 ruleset_fd = open(dir_s1d1, O_PATH | O_DIRECTORY | O_CLOEXEC); in TEST_F_FORK() 500 ruleset_fd = open(dir_s1d1, O_DIRECTORY | O_CLOEXEC); in TEST_F_FORK() 517 path_beneath.parent_fd = open(dir_s1d2, O_DIRECTORY | O_CLOEXEC); in TEST_F_FORK() 531 open(dir_s1d2, O_PATH | O_DIRECTORY | O_CLOEXEC); in TEST_F_FORK() 613 path_beneath_file.parent_fd = open(file1_s1d2, O_PATH | O_CLOEXEC); in TEST_F_FORK() 618 open(dir_s1d2, O_PATH | O_DIRECTORY | O_CLOEXEC); in TEST_F_FORK() 671 open(TMP_DIR, O_PATH | O_DIRECTORY | O_CLOEXEC); in TEST_F_FORK() 698 path_beneath.parent_fd = open(file1_s1d2, O_PATH | O_CLOEXEC); in TEST_F_FORK() [all …]
|
| /linux/tools/testing/selftests/pid_namespace/ |
| H A D | pid_max.c | 57 fd = open("/proc/sys/kernel/pid_max", O_RDWR | O_CLOEXEC | O_NOCTTY); in pid_max_cb() 103 fd = open("/proc/sys/kernel/pid_max", O_RDWR | O_CLOEXEC | O_NOCTTY); in pid_max_nested_inner() 178 fd = open("/proc/sys/kernel/pid_max", O_RDWR | O_CLOEXEC | O_NOCTTY); in pid_max_nested_outer() 247 fd = open("/proc/sys/kernel/pid_max", O_RDWR | O_CLOEXEC | O_NOCTTY); in pid_max_nested_limit_inner() 304 fd = open("/proc/sys/kernel/pid_max", O_RDWR | O_CLOEXEC | O_NOCTTY); in pid_max_nested_limit_outer()
|
| /linux/tools/testing/selftests/filesystems/binderfs/ |
| H A D | binderfs_test.c | 92 fd = open(device_path, O_RDONLY | O_CLOEXEC); in __do_binderfs_test() 115 fd = open(device_path, O_CLOEXEC | O_RDONLY); in __do_binderfs_test() 162 fd = open(device_path, O_CLOEXEC | O_RDONLY); in __do_binderfs_test() 258 setgroups_fd = open(path, O_WRONLY | O_CLOEXEC | O_NOFOLLOW); in write_id_mapping() 283 fd = open(path, O_WRONLY | O_CLOEXEC | O_NOFOLLOW); in write_id_mapping() 425 fd = open(device_path, O_RDONLY | O_CLOEXEC); in TEST() 442 fds[i] = open(device_path, O_RDONLY | O_CLOEXEC); in TEST()
|
| /linux/tools/testing/selftests/filesystems/ |
| H A D | kernfs_test.c | 18 fd = open("/sys/kernel/warn_count", O_RDONLY | O_CLOEXEC); in TEST() 30 fd = open("/sys/kernel/warn_count", O_RDONLY | O_CLOEXEC); in TEST()
|
| H A D | utils.c | 193 setgroups_fd = open(path, O_WRONLY | O_CLOEXEC); in write_id_mapping() 212 fd = open(path, O_WRONLY | O_CLOEXEC); in write_id_mapping() 300 ret = open(path_ns, O_RDONLY | O_CLOEXEC | O_NOCTTY); in get_userns_fd_from_idmap() 430 fd_userns = open(path, O_RDONLY | O_CLOEXEC); in create_userns_hierarchy()
|
| /linux/tools/testing/selftests/proc/ |
| H A D | proc-pidns.c | 34 int fd = open(path, O_WRONLY|O_CREAT|O_CLOEXEC, 0644); in touch() 49 self->host_mntns = open("/proc/self/ns/mnt", O_RDONLY|O_CLOEXEC); in FIXTURE_SETUP() 70 self->host_pidns = open("/proc/self/ns/pid", O_RDONLY|O_CLOEXEC); in FIXTURE_SETUP() 90 self->dummy_pidns = open("/tmp/dummy/pidns", O_RDONLY|O_CLOEXEC); in FIXTURE_SETUP()
|
| /linux/tools/testing/selftests/pidfd/ |
| H A D | pidfd_test.c | 104 pidfd = open("/proc/self", O_DIRECTORY | O_CLOEXEC); in test_pidfd_send_signal_simple_success() 168 pidfd = open(buf, O_DIRECTORY | O_CLOEXEC); in test_pidfd_send_signal_exited_fail() 272 pidfd = open(buf, O_DIRECTORY | O_CLOEXEC); in test_pidfd_send_signal_recycled_pid_fail() 301 ret = pipe2(pipe_fds, O_CLOEXEC); in test_pidfd_send_signal_recycled_pid_fail() 408 pidfd = open("/proc/self", O_DIRECTORY | O_CLOEXEC); in test_pidfd_send_signal_syscall_support()
|
| H A D | pidfd_setns_test.c | 82 fd = open("/proc/self/ns/time_for_children", O_RDONLY | O_CLOEXEC); in switch_timens() 106 proc_fd = open("/proc/self/ns", O_DIRECTORY | O_CLOEXEC); in FIXTURE_SETUP() 119 self->nsfds[i] = openat(proc_fd, info->name, O_RDONLY | O_CLOEXEC); in FIXTURE_SETUP() 269 self->nsfds[i] = openat(proc_fd, info->name, O_RDONLY | O_CLOEXEC); in FIXTURE_SETUP() 282 self->child_nsfds1[i] = open(p, O_RDONLY | O_CLOEXEC); in FIXTURE_SETUP() 295 self->child_nsfds2[i] = open(p, O_RDONLY | O_CLOEXEC); in FIXTURE_SETUP() 365 return open(path, O_RDONLY | O_CLOEXEC); in preserve_ns()
|
| H A D | pidfd_bind_mount.c | 77 pidfd = open(proc_path, O_RDONLY | O_NOCTTY | O_CLOEXEC); in TEST_F() 103 fd_pidfd_mnt = openat(-EBADF, self->template, O_RDONLY | O_NOCTTY | O_CLOEXEC); in TEST_F()
|
| /linux/tools/include/uapi/asm-generic/ |
| H A D | fcntl.h | |
| /linux/include/uapi/asm-generic/ |
| H A D | fcntl.h | 61 #ifndef O_CLOEXEC 62 #define O_CLOEXEC 02000000 /* set close_on_exec */ macro
|
| /linux/samples/pidfd/ |
| H A D | pidfd-metadata.c | 58 procfd = open(path, O_DIRECTORY | O_RDONLY | O_CLOEXEC); in pidfd_metadata_fd() 105 statusfd = openat(procfd, "status", O_RDONLY | O_CLOEXEC); in main()
|
| /linux/mm/ |
| H A D | secretmem.c | 228 BUILD_BUG_ON(SECRETMEM_FLAGS_MASK & O_CLOEXEC); in SYSCALL_DEFINE1() 233 if (flags & ~(SECRETMEM_FLAGS_MASK | O_CLOEXEC)) in SYSCALL_DEFINE1() 238 return FD_ADD(flags & O_CLOEXEC, secretmem_file_create(flags)); in SYSCALL_DEFINE1()
|
| /linux/tools/testing/selftests/core/ |
| H A D | close_range_test.c | 47 fd = open("/dev/null", O_RDONLY | O_CLOEXEC); in TEST() 120 fd = open("/dev/null", O_RDONLY | O_CLOEXEC); in TEST() 209 fd = open("/dev/null", O_RDONLY | O_CLOEXEC); in TEST() 637 fd = open("/dev/null", O_RDONLY | O_CLOEXEC); in TEST() 649 fd = open(path, O_CREAT | O_RDONLY | O_CLOEXEC, 0600); in TEST() 656 fd = open(path, O_RDONLY | O_CLOEXEC); in TEST()
|
| /linux/tools/testing/selftests/dmabuf-heaps/ |
| H A D | dmabuf-heap.c | 130 return dmabuf_heap_alloc_fdflags(fd, len, O_RDWR | O_CLOEXEC, flags, in dmabuf_heap_alloc() 297 .fd_flags = O_RDWR | O_CLOEXEC, in dmabuf_heap_alloc_older() 329 .fd_flags = O_RDWR | O_CLOEXEC, in dmabuf_heap_alloc_newer() 385 ~(O_RDWR | O_CLOEXEC), 0, &dmabuf_fd); in test_alloc_errors()
|
| /linux/tools/testing/selftests/exec/ |
| H A D | check-exec.c | 164 self->pipefd = open(procfd_path, O_RDWR | O_CLOEXEC); in FIXTURE_SETUP() 186 fd_in = open(binary_path, O_CLOEXEC | O_RDONLY); in fill_exec_fd() 208 fd_out = open(path, O_CLOEXEC | O_WRONLY); in fill_exec_path() 250 int flags = O_CLOEXEC; in test_exec_path()
|
| /linux/io_uring/ |
| H A D | openclose.c | 79 if (open->file_slot && (open->how.flags & O_CLOEXEC)) in __io_openat_prep() 289 ifi->o_flags = O_CLOEXEC; in io_install_fixed_fd_prep() 326 if (p->flags & ~(O_CLOEXEC | O_NONBLOCK | O_DIRECT | O_NOTIFICATION_PIPE)) in io_pipe_prep() 342 if (p->flags & O_CLOEXEC) in io_pipe_fixed()
|
| /linux/tools/testing/selftests/mount_setattr/ |
| H A D | mount_setattr_test.c | 166 fd = open(path, O_WRONLY | O_CLOEXEC | O_NOCTTY | O_NOFOLLOW); in write_file() 419 fd = creat(NOSYMFOLLOW_TARGET, O_RDWR | O_CLOEXEC); in FIXTURE_SETUP() 626 fd = open("/mnt/A/AA/B/b", O_RDWR | O_CLOEXEC | O_CREAT | O_EXCL, 0777); in TEST_F() 675 fd = open("/mnt/A/AA/B/b", O_RDWR | O_CLOEXEC | O_CREAT | O_EXCL, 0777); in TEST_F() 705 dfd = open("/mnt/A/AA/B", O_DIRECTORY | O_CLOEXEC); in TEST_F() 981 fd = open("/mnt/A", O_DIRECTORY | O_CLOEXEC); in TEST_F() 1109 fd = open("/dev/null", O_RDONLY | O_CLOEXEC); in TEST_F() 1138 attr.userns_fd = open("/proc/1/ns/user", O_RDONLY | O_CLOEXEC); in TEST_F() 1220 ret = open(path, O_RDONLY | O_CLOEXEC); in get_userns_fd() 1477 fd = open(NOSYMFOLLOW_SYMLINK, O_RDWR | O_CLOEXEC); in TEST_F() [all …]
|
| /linux/tools/testing/selftests/drivers/ntsync/ |
| H A D | ntsync.c | 150 fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY); in TEST() 234 fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY); in TEST() 385 fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY); in TEST() 450 fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY); in TEST() 510 fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY); in TEST() 622 fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY); in TEST() 757 fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY); in TEST() 950 fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY); in TEST() 1073 fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY); in TEST() 1184 fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY); in TEST() [all …]
|
| /linux/include/uapi/linux/ |
| H A D | eventfd.h | 8 #define EFD_CLOEXEC O_CLOEXEC
|
| H A D | timerfd.h | 32 #define TFD_CLOEXEC O_CLOEXEC
|