arch/powerpc/kvm/book3s_64_mmu_hv.c
1956
ret = anon_inode_getfd("kvm-htab", &kvm_htab_fops, ctx, rwflag | O_CLOEXEC);
arch/powerpc/kvm/book3s_64_vio.c
334
stt, O_RDWR | O_CLOEXEC);
arch/powerpc/platforms/pseries/papr-hvpipe.c
506
FD_PREPARE(fdf, O_RDONLY | O_CLOEXEC,
arch/powerpc/platforms/pseries/papr-platform-dump.c
335
fd = FD_ADD(O_RDONLY | O_CLOEXEC,
arch/powerpc/platforms/pseries/papr-rtas-common.c
214
fd = FD_ADD(O_RDONLY | O_CLOEXEC,
arch/um/os-Linux/mem.c
146
fd = open(tempdir, O_CLOEXEC | O_RDWR | O_EXCL | O_TMPFILE, 0700);
arch/um/os-Linux/skas/process.c
415
stub_exe_fd = open(tmpfile, O_RDONLY | O_CLOEXEC | O_NOFOLLOW);
drivers/accel/amdxdna/amdxdna_ubuf.c
219
exp_info.flags = O_RDWR | O_CLOEXEC;
drivers/accel/ivpu/ivpu_gem_userptr.c
113
exp_info.flags = O_RDWR | O_CLOEXEC;
drivers/android/binder.c
4695
int fd = get_unused_fd_flags(O_CLOEXEC);
drivers/android/tests/binder_alloc_kunit.c
521
O_RDWR | O_CLOEXEC);
drivers/dma-buf/dma-buf.c
454
fd = get_unused_fd_flags(O_CLOEXEC);
drivers/dma-buf/sw_sync.c
347
int fd = get_unused_fd_flags(O_CLOEXEC);
drivers/dma-buf/sync_file.c
216
int fd = get_unused_fd_flags(O_CLOEXEC);
drivers/dma-buf/udmabuf.c
441
flags = head->flags & UDMABUF_FLAGS_CLOEXEC ? O_CLOEXEC : 0;
drivers/gpio/gpiolib-cdev.c
1705
fd = get_unused_fd_flags(O_RDONLY | O_CLOEXEC);
drivers/gpio/gpiolib-cdev.c
1712
O_RDONLY | O_CLOEXEC);
drivers/gpio/gpiolib-cdev.c
2130
fd = get_unused_fd_flags(O_RDONLY | O_CLOEXEC);
drivers/gpio/gpiolib-cdev.c
2139
O_RDONLY | O_CLOEXEC);
drivers/gpio/gpiolib-cdev.c
377
FD_PREPARE(fdf, O_RDONLY | O_CLOEXEC,
drivers/gpio/gpiolib-cdev.c
379
lh, O_RDONLY | O_CLOEXEC));
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
1602
fd = get_unused_fd_flags(O_CLOEXEC);
drivers/gpu/drm/drm_atomic_uapi.c
1358
fence_state->fd = get_unused_fd_flags(O_CLOEXEC);
drivers/gpu/drm/drm_lease.c
494
if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
drivers/gpu/drm/drm_lease.c
532
fd = get_unused_fd_flags(cl->flags & (O_CLOEXEC | O_NONBLOCK));
drivers/gpu/drm/drm_syncobj.c
667
fd = get_unused_fd_flags(O_CLOEXEC);
drivers/gpu/drm/drm_syncobj.c
763
int fd = get_unused_fd_flags(O_CLOEXEC);
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
508
out_fence_fd = get_unused_fd_flags(O_CLOEXEC);
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
3424
out_fence_fd = get_unused_fd_flags(O_CLOEXEC);
drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c
119
exp_info.flags = O_CLOEXEC;
drivers/gpu/drm/i915/i915_perf.c
3899
f_flags |= O_CLOEXEC;
drivers/gpu/drm/msm/msm_gem_submit.c
603
out_fence_fd = get_unused_fd_flags(O_CLOEXEC);
drivers/gpu/drm/msm/msm_gem_vma.c
1467
out_fence_fd = get_unused_fd_flags(O_CLOEXEC);
drivers/gpu/drm/virtio/virtgpu_submit.c
421
err = get_unused_fd_flags(O_CLOEXEC);
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
4100
out_fence_fd = get_unused_fd_flags(O_CLOEXEC);
drivers/hv/mshv_root_main.c
1116
O_RDWR | O_CLOEXEC);
drivers/hv/mshv_root_main.c
2029
ret = FD_ADD(O_CLOEXEC, anon_inode_getfile("mshv_partition",
drivers/hv/mshv_vtl_main.c
124
fd = get_unused_fd_flags(O_CLOEXEC);
drivers/iio/industrialio-buffer.c
2050
ib, O_RDWR | O_CLOEXEC);
drivers/iio/industrialio-event.c
213
indio_dev, O_RDONLY | O_CLOEXEC);
drivers/infiniband/core/rdma_core.c
474
new_fd = get_unused_fd_flags(O_CLOEXEC);
drivers/infiniband/core/uverbs_std_types_dmabuf.c
117
exp_info.flags = O_CLOEXEC;
drivers/iommu/iommufd/eventq.c
411
return get_unused_fd_flags(O_CLOEXEC);
drivers/iommu/iommufd/selftest.c
1485
fdno = get_unused_fd_flags(O_CLOEXEC);
drivers/media/common/videobuf2/videobuf2-core.c
2439
if (flags & ~(O_CLOEXEC | O_ACCMODE)) {
drivers/media/mc/mc-request.c
316
FD_PREPARE(fdf, O_CLOEXEC,
drivers/media/mc/mc-request.c
318
O_CLOEXEC));
drivers/misc/ntsync.c
724
FD_PREPARE(fdf, O_CLOEXEC,
drivers/nvme/host/tcp.c
1795
sock_file = sock_alloc_file(queue->sock, O_CLOEXEC, NULL);
drivers/nvme/target/tcp.c
1925
sock_file = sock_alloc_file(queue->sock, O_CLOEXEC, NULL);
drivers/vfio/group.c
314
fd = FD_ADD(O_CLOEXEC, vfio_device_open_file(device));
drivers/vfio/vfio_main.c
868
fd = get_unused_fd_flags(O_CLOEXEC);
drivers/virt/nitro_enclaves/ne_misc_dev.c
1650
enclave_fd = get_unused_fd_flags(O_CLOEXEC);
drivers/xen/gntdev-dmabuf.c
360
CLASS(get_unused_fd, ret)(O_CLOEXEC);
fs/9p/vfs_inode_dotl.c
181
{ O_CLOEXEC, P9_DOTL_CLOEXEC },
fs/autofs/dev-ioctl.c
241
return FD_ADD(O_CLOEXEC, dentry_open(&path, O_RDONLY, current_cred()));
fs/eventfd.c
384
BUILD_BUG_ON(EFD_CLOEXEC != O_CLOEXEC);
fs/eventpoll.c
2173
BUILD_BUG_ON(EPOLL_CLOEXEC != O_CLOEXEC);
fs/eventpoll.c
2187
FD_PREPARE(fdf, O_RDWR | (flags & O_CLOEXEC),
fs/eventpoll.c
2189
O_RDWR | (flags & O_CLOEXEC)));
fs/fcntl.c
461
err = f_dupfd(argi, filp, O_CLOEXEC);
fs/file.c
1334
__set_open_fd(fd, fdt, flags & O_CLOEXEC);
fs/file.c
1431
if ((flags & ~O_CLOEXEC) != 0)
fs/file.c
606
__set_open_fd(fd, fdt, flags & O_CLOEXEC);
fs/fsopen.c
153
return fscontext_create_fd(fc, flags & FSOPEN_CLOEXEC ? O_CLOEXEC : 0);
fs/fsopen.c
207
return fscontext_create_fd(fc, flags & FSPICK_CLOEXEC ? O_CLOEXEC : 0);
fs/namespace.c
3183
BUILD_BUG_ON(OPEN_TREE_CLOEXEC != O_CLOEXEC);
fs/namespace.c
4497
FD_PREPARE(fdf, (flags & FSMOUNT_CLOEXEC) ? O_CLOEXEC : 0,
fs/notify/fanotify/fanotify_user.c
1693
f_flags |= O_CLOEXEC;
fs/notify/fanotify/fanotify_user.c
201
__O_SYNC | O_DSYNC | O_CLOEXEC | \
fs/notify/inotify/inotify_user.c
700
BUILD_BUG_ON(IN_CLOEXEC != O_CLOEXEC);
fs/nsfs.c
133
return FD_ADD(O_CLOEXEC, dentry_open(&path, O_RDONLY, current_cred()));
fs/nsfs.c
350
FD_PREPARE(fdf, O_CLOEXEC, dentry_open(&path, O_RDONLY, current_cred()));
fs/open.c
1163
#define O_PATH_FLAGS (O_DIRECTORY | O_NOFOLLOW | O_PATH | O_CLOEXEC)
fs/open.c
1184
u64 strip = O_CLOEXEC;
fs/pidfs.c
884
(O_RDONLY | O_WRONLY | O_RDWR | O_NONBLOCK | O_CLOEXEC | O_EXCL)
fs/pipe.c
987
if (flags & ~(O_CLOEXEC | O_NONBLOCK | O_DIRECT | O_NOTIFICATION_PIPE))
fs/proc/fd.c
44
f_flags |= O_CLOEXEC;
fs/signalfd.c
254
BUILD_BUG_ON(SFD_CLOEXEC != O_CLOEXEC);
fs/signalfd.c
273
fd = FD_ADD(flags & O_CLOEXEC,
fs/timerfd.c
400
BUILD_BUG_ON(TFD_CLOEXEC != O_CLOEXEC);
fs/xfs/xfs_healthmon.c
1246
O_CLOEXEC | O_RDONLY);
include/linux/eventfd.h
26
#define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK)
include/linux/fcntl.h
13
O_NOATIME | O_CLOEXEC | O_PATH | __O_TMPFILE)
include/linux/net.h
80
#define SOCK_CLOEXEC O_CLOEXEC
include/linux/userfaultfd_k.h
33
#define UFFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK)
include/trace/misc/fs.h
40
{ O_CLOEXEC, "O_CLOEXEC" })
include/uapi/asm-generic/fcntl.h
61
#ifndef O_CLOEXEC
include/uapi/drm/drm.h
931
#define DRM_CLOEXEC O_CLOEXEC
include/uapi/linux/dma-heap.h
19
#define DMA_HEAP_VALID_FD_FLAGS (O_CLOEXEC | O_ACCMODE)
include/uapi/linux/eventfd.h
8
#define EFD_CLOEXEC O_CLOEXEC
include/uapi/linux/eventpoll.h
23
#define EPOLL_CLOEXEC O_CLOEXEC
include/uapi/linux/inotify.h
72
#define IN_CLOEXEC O_CLOEXEC
include/uapi/linux/mount.h
66
#define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */
include/uapi/linux/signalfd.h
17
#define SFD_CLOEXEC O_CLOEXEC
include/uapi/linux/timerfd.h
32
#define TFD_CLOEXEC O_CLOEXEC
io_uring/io_uring.c
2739
fd = get_unused_fd_flags(O_RDWR | O_CLOEXEC);
io_uring/io_uring.c
2755
O_RDWR | O_CLOEXEC, NULL);
io_uring/mock_file.c
257
FD_PREPARE(fdf, O_RDWR | O_CLOEXEC,
io_uring/mock_file.c
259
O_RDWR | O_CLOEXEC, NULL));
io_uring/openclose.c
298
ifi->o_flags = O_CLOEXEC;
io_uring/openclose.c
335
if (p->flags & ~(O_CLOEXEC | O_NONBLOCK | O_DIRECT | O_NOTIFICATION_PIPE))
io_uring/openclose.c
352
if (p->flags & O_CLOEXEC)
io_uring/openclose.c
76
if (open->file_slot && (open->how.flags & O_CLOEXEC))
io_uring/zcrx.c
670
fd = get_unused_fd_flags(O_CLOEXEC);
io_uring/zcrx.c
684
ifq, O_CLOEXEC, NULL);
ipc/mqueue.c
924
fd = FD_ADD(O_CLOEXEC, mqueue_file_open(name, mnt, oflag, ro, mode, attr));
kernel/bpf/bpf_iter.c
643
flags = O_RDONLY | O_CLOEXEC;
kernel/bpf/btf.c
8146
return anon_inode_getfd("btf", &btf_fops, btf, O_RDONLY | O_CLOEXEC);
kernel/bpf/syscall.c
1190
flags | O_CLOEXEC);
kernel/bpf/syscall.c
2535
O_RDWR | O_CLOEXEC);
kernel/bpf/syscall.c
3459
fd = get_unused_fd_flags(O_CLOEXEC);
kernel/bpf/syscall.c
3472
link, O_CLOEXEC);
kernel/bpf/syscall.c
3502
link, O_CLOEXEC);
kernel/bpf/syscall.c
6014
fd = anon_inode_getfd("bpf-stats", &bpf_stats_fops, NULL, O_CLOEXEC);
kernel/bpf/token.c
169
FD_PREPARE(fdf, O_CLOEXEC,
kernel/events/core.c
13879
f_flags |= O_CLOEXEC;
kernel/fork.c
1894
CLASS(get_unused_fd, pidfd)(O_CLOEXEC);
kernel/liveupdate/luo_core.c
286
argp->fd = get_unused_fd_flags(O_CLOEXEC);
kernel/liveupdate/luo_core.c
316
argp->fd = get_unused_fd_flags(O_CLOEXEC);
kernel/liveupdate/luo_session.c
255
argp->fd = get_unused_fd_flags(O_CLOEXEC);
kernel/pid.c
925
ret = receive_fd(file, NULL, O_CLOEXEC);
kernel/seccomp.c
1731
if (addfd.newfd_flags & ~O_CLOEXEC)
kernel/seccomp.c
1995
listener = get_unused_fd_flags(O_CLOEXEC);
kernel/trace/trace_syscalls.c
176
{ O_CLOEXEC, "O_CLOEXEC" },
kernel/trace/trace_syscalls.c
433
"{ 0x%x, \"O_CLOEXEC\" }) : \"O_RDONLY\", ", O_CLOEXEC);
mm/memfd.c
521
fd_flags = (flags & MFD_CLOEXEC) ? O_CLOEXEC : 0;
mm/secretmem.c
227
BUILD_BUG_ON(SECRETMEM_FLAGS_MASK & O_CLOEXEC);
mm/secretmem.c
232
if (flags & ~(SECRETMEM_FLAGS_MASK | O_CLOEXEC))
mm/secretmem.c
237
return FD_ADD(flags & O_CLOEXEC, secretmem_file_create(flags));
net/compat.c
294
unsigned int o_flags = (msg->msg_flags & MSG_CMSG_CLOEXEC) ? O_CLOEXEC : 0;
net/core/scm.c
354
unsigned int o_flags = (msg->msg_flags & MSG_CMSG_CLOEXEC) ? O_CLOEXEC : 0;
net/handshake/netlink.c
112
FD_PREPARE(fdf, O_CLOEXEC, sock->file);
net/socket.c
1691
BUILD_BUG_ON(SOCK_CLOEXEC != O_CLOEXEC);
net/socket.c
1756
return sock_map_fd(sock, flags & (O_CLOEXEC | O_NONBLOCK));
net/unix/af_unix.c
3272
return FD_ADD(O_CLOEXEC, dentry_open(&unix_sk(sk)->path, O_PATH, current_cred()));
samples/acrn/vm-sample.c
61
hsm_fd = open("/dev/acrn_hsm", O_RDWR|O_CLOEXEC);
samples/binderfs/binderfs_example.c
53
fd = open("/dev/binderfs/binder-control", O_RDONLY | O_CLOEXEC);
samples/landlock/sandboxer.c
153
path_beneath.parent_fd = open(path_list[i], O_PATH | O_CLOEXEC);
samples/nitro_enclaves/ne_ioctl_sample.c
789
ne_dev_fd = open(NE_DEV_NAME, O_RDWR | O_CLOEXEC);
samples/pidfd/pidfd-metadata.c
105
statusfd = openat(procfd, "status", O_RDONLY | O_CLOEXEC);
samples/pidfd/pidfd-metadata.c
58
procfd = open(path, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
samples/uhid/uhid-example.c
416
fd = open(path, O_RDWR | O_CLOEXEC);
security/landlock/syscalls.c
256
ruleset, O_RDWR | O_CLOEXEC);
sound/core/compress_offload.c
1083
fd_i = get_unused_fd_flags(O_WRONLY|O_CLOEXEC);
sound/core/compress_offload.c
1086
fd_o = get_unused_fd_flags(O_RDONLY|O_CLOEXEC);
sound/core/timer.c
2208
timer_fd = anon_inode_getfd(utimer->name, &snd_utimer_fops, utimer, O_RDWR | O_CLOEXEC);
tools/bpf/bpftool/feature.c
153
fd = open(path, O_RDONLY | O_CLOEXEC);
tools/gpio/gpio-watch.c
35
fd = open(argv[1], O_RDWR | O_CLOEXEC);
tools/hv/hv_fcopy_uio_daemon.c
162
O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, 0744);
tools/hv/hv_kvp_daemon.c
1843
kvp_fd = open("/dev/vmbus/hv_kvp", O_RDWR | O_CLOEXEC);
tools/hv/hv_kvp_daemon.c
277
fd = open(fname, O_RDWR | O_CREAT | O_CLOEXEC, 0644 /* rw-r--r-- */);
tools/include/uapi/drm/drm.h
931
#define DRM_CLOEXEC O_CLOEXEC
tools/include/uapi/linux/mount.h
65
#define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */
tools/lib/bpf/btf.c
1270
fd = open(path, O_RDONLY | O_CLOEXEC);
tools/lib/bpf/elf.c
36
fd = open(binary_path, O_RDONLY | O_CLOEXEC);
tools/lib/bpf/libbpf.c
11460
fd = open(file, O_WRONLY | O_APPEND | O_CLOEXEC, 0);
tools/lib/bpf/libbpf.c
14255
fd = open(fcpu, O_RDONLY | O_CLOEXEC);
tools/lib/bpf/libbpf.c
1591
obj->efile.fd = open(obj->path, O_RDONLY | O_CLOEXEC);
tools/lib/bpf/libbpf_internal.h
701
err = sys_dup3(tmp_fd, fixed_fd, O_CLOEXEC);
tools/lib/bpf/linker.c
250
linker->fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0644);
tools/lib/bpf/linker.c
529
fd = open(filename, O_RDONLY | O_CLOEXEC);
tools/lib/bpf/zip.c
205
fd = open(path, O_RDONLY | O_CLOEXEC);
tools/perf/builtin-daemon.c
1025
fd = inotify_init1(IN_NONBLOCK|O_CLOEXEC);
tools/perf/builtin-daemon.c
1149
fd = open(path, O_RDWR|O_CREAT|O_CLOEXEC, 0640);
tools/perf/builtin-trace.c
94
#ifndef O_CLOEXEC
tools/perf/trace/beauty/include/uapi/linux/mount.h
66
#define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */
tools/perf/util/data.c
284
int fd = open(data->file.path, O_CREAT|O_RDWR|O_TRUNC|O_CLOEXEC, S_IRUSR|S_IWUSR);
tools/perf/util/dso.c
544
int fd = open(name, O_RDONLY|O_CLOEXEC);
tools/perf/util/evlist.c
1960
fd = open(s, O_RDWR | O_NONBLOCK | O_CLOEXEC);
tools/perf/util/evlist.c
1971
fd = open(p, O_RDWR | O_NONBLOCK | O_CLOEXEC);
tools/perf/util/header.c
1345
io_dir__init(&dir, open(path, O_CLOEXEC | O_DIRECTORY | O_RDONLY));
tools/perf/util/header.c
1404
io_dir__init(&dir, open(path, O_CLOEXEC | O_DIRECTORY | O_RDONLY));
tools/perf/util/hwmon_pmu.c
248
io_dir__init(&dir, open(pmu->hwmon_dir, O_CLOEXEC | O_DIRECTORY | O_RDONLY));
tools/perf/util/hwmon_pmu.c
417
int dir = open(hwm->hwmon_dir, O_CLOEXEC | O_DIRECTORY | O_RDONLY);
tools/perf/util/hwmon_pmu.c
716
io_dir__init(&class_hwmon_dir, open(buf, O_CLOEXEC | O_DIRECTORY | O_RDONLY));
tools/perf/util/hwmon_pmu.c
767
int dir = open(hwm->hwmon_dir, O_CLOEXEC | O_DIRECTORY | O_RDONLY);
tools/perf/util/machine.c
1387
io_dir__init(&iod, open(path, O_CLOEXEC | O_DIRECTORY | O_RDONLY));
tools/perf/util/pmu.c
2525
caps_fd = open(caps_path, O_CLOEXEC | O_DIRECTORY | O_RDONLY);
tools/perf/util/synthetic-events.c
817
io_dir__init(&iod, open(filename, O_CLOEXEC | O_DIRECTORY | O_RDONLY));
tools/perf/util/tp_pmu.c
41
io_dir__init(&evt_dir, open(evt_path, O_CLOEXEC | O_DIRECTORY | O_RDONLY));
tools/perf/util/tp_pmu.c
74
io_dir__init(&events_dir, open(events_dir_path, O_CLOEXEC | O_DIRECTORY | O_RDONLY));
tools/perf/util/util.h
74
#ifndef O_CLOEXEC
tools/testing/selftests/bpf/network_helpers.c
542
nsfd = open(nspath, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/bpf/prog_tests/bpf_mod_race.c
69
uffd = sys_userfaultfd(O_CLOEXEC);
tools/testing/selftests/bpf/prog_tests/dmabuf_iter.c
81
.fd_flags = O_RDWR | O_CLOEXEC,
tools/testing/selftests/bpf/prog_tests/test_sysctl.c
1435
fd = open(sysctl_path, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/bpf/prog_tests/test_sysctl.c
1492
fd = open(sysctl_path, test->open_flags | O_CLOEXEC);
tools/testing/selftests/bpf/prog_tests/token.c
233
fd = open(path, O_WRONLY | O_CLOEXEC | O_NOCTTY | O_NOFOLLOW);
tools/testing/selftests/bpf/prog_tests/xdp_bonding.c
46
nsfd = open(nspath, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/bpf/trace_helpers.c
441
fd = open(path, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/bpf/veristat.c
489
fd = open(path, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/cgroup/lib/cgroup_util.c
493
return open(dir, O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW | O_PATH);
tools/testing/selftests/cgroup/test_memcontrol.c
1052
O_RDWR | O_APPEND | O_CLOEXEC);
tools/testing/selftests/cgroup/test_memcontrol.c
1073
mem_peak_fd = cg_open(memcg, "memory.peak", O_RDWR | O_APPEND | O_CLOEXEC);
tools/testing/selftests/cgroup/test_memcontrol.c
282
peak_fd = cg_open(memcg, "memory.peak", O_RDWR | O_APPEND | O_CLOEXEC);
tools/testing/selftests/cgroup/test_memcontrol.c
303
peak_fd2 = cg_open(memcg, "memory.peak", O_RDWR | O_APPEND | O_CLOEXEC);
tools/testing/selftests/cgroup/test_memcontrol.c
308
peak_fd3 = cg_open(memcg, "memory.peak", O_RDWR | O_APPEND | O_CLOEXEC);
tools/testing/selftests/cgroup/test_memcontrol.c
337
peak_fd4 = cg_open(memcg, "memory.peak", O_RDWR | O_APPEND | O_CLOEXEC);
tools/testing/selftests/core/close_range_test.c
120
fd = open("/dev/null", O_RDONLY | O_CLOEXEC);
tools/testing/selftests/core/close_range_test.c
209
fd = open("/dev/null", O_RDONLY | O_CLOEXEC);
tools/testing/selftests/core/close_range_test.c
47
fd = open("/dev/null", O_RDONLY | O_CLOEXEC);
tools/testing/selftests/core/close_range_test.c
637
fd = open("/dev/null", O_RDONLY | O_CLOEXEC);
tools/testing/selftests/core/close_range_test.c
649
fd = open(path, O_CREAT | O_RDONLY | O_CLOEXEC, 0600);
tools/testing/selftests/core/close_range_test.c
656
fd = open(path, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/coredump/coredump_test_helpers.c
114
fd = open("/proc/sys/kernel/core_pattern", O_WRONLY | O_CLOEXEC);
tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
130
return dmabuf_heap_alloc_fdflags(fd, len, O_RDWR | O_CLOEXEC, flags,
tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
297
.fd_flags = O_RDWR | O_CLOEXEC,
tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
329
.fd_flags = O_RDWR | O_CLOEXEC,
tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
385
~(O_RDWR | O_CLOEXEC), 0, &dmabuf_fd);
tools/testing/selftests/drivers/ntsync/ntsync.c
1073
fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY);
tools/testing/selftests/drivers/ntsync/ntsync.c
1184
fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY);
tools/testing/selftests/drivers/ntsync/ntsync.c
1312
stress_device = open("/dev/ntsync", O_CLOEXEC | O_RDONLY);
tools/testing/selftests/drivers/ntsync/ntsync.c
150
fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY);
tools/testing/selftests/drivers/ntsync/ntsync.c
234
fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY);
tools/testing/selftests/drivers/ntsync/ntsync.c
385
fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY);
tools/testing/selftests/drivers/ntsync/ntsync.c
450
fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY);
tools/testing/selftests/drivers/ntsync/ntsync.c
510
fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY);
tools/testing/selftests/drivers/ntsync/ntsync.c
622
fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY);
tools/testing/selftests/drivers/ntsync/ntsync.c
757
fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY);
tools/testing/selftests/drivers/ntsync/ntsync.c
950
fd = open("/dev/ntsync", O_CLOEXEC | O_RDONLY);
tools/testing/selftests/exec/check-exec.c
164
self->pipefd = open(procfd_path, O_RDWR | O_CLOEXEC);
tools/testing/selftests/exec/check-exec.c
186
fd_in = open(binary_path, O_CLOEXEC | O_RDONLY);
tools/testing/selftests/exec/check-exec.c
208
fd_out = open(path, O_CLOEXEC | O_WRONLY);
tools/testing/selftests/exec/check-exec.c
250
int flags = O_CLOEXEC;
tools/testing/selftests/exec/execveat.c
277
int dot_dfd_cloexec = open_or_die(".", O_DIRECTORY|O_RDONLY|O_CLOEXEC);
tools/testing/selftests/exec/execveat.c
289
int fd_cloexec = open_or_die("execveat", O_RDONLY|O_CLOEXEC);
tools/testing/selftests/exec/execveat.c
290
int fd_script_cloexec = open_or_die("script", O_RDONLY|O_CLOEXEC);
tools/testing/selftests/filesystems/binderfs/binderfs_test.c
115
fd = open(device_path, O_CLOEXEC | O_RDONLY);
tools/testing/selftests/filesystems/binderfs/binderfs_test.c
162
fd = open(device_path, O_CLOEXEC | O_RDONLY);
tools/testing/selftests/filesystems/binderfs/binderfs_test.c
258
setgroups_fd = open(path, O_WRONLY | O_CLOEXEC | O_NOFOLLOW);
tools/testing/selftests/filesystems/binderfs/binderfs_test.c
283
fd = open(path, O_WRONLY | O_CLOEXEC | O_NOFOLLOW);
tools/testing/selftests/filesystems/binderfs/binderfs_test.c
425
fd = open(device_path, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/filesystems/binderfs/binderfs_test.c
442
fds[i] = open(device_path, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/filesystems/binderfs/binderfs_test.c
92
fd = open(device_path, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/filesystems/devpts_pts.c
105
master = open(ptmx, O_RDWR | O_NOCTTY | O_CLOEXEC);
tools/testing/selftests/filesystems/devpts_pts.c
123
slave = ioctl(master, TIOCGPTPEER, O_RDWR | O_NOCTTY | O_CLOEXEC);
tools/testing/selftests/filesystems/fclog.c
37
self->host_mntns = open("/proc/self/ns/mnt", O_RDONLY|O_CLOEXEC);
tools/testing/selftests/filesystems/file_stressor.c
127
fd = open(path, O_CREAT | O_RDONLY | O_CLOEXEC, 0644);
tools/testing/selftests/filesystems/file_stressor.c
142
self->fd_proc_pid[i] = open(path, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
tools/testing/selftests/filesystems/kernfs_test.c
18
fd = open("/sys/kernel/warn_count", O_RDONLY | O_CLOEXEC);
tools/testing/selftests/filesystems/kernfs_test.c
30
fd = open("/sys/kernel/warn_count", O_RDONLY | O_CLOEXEC);
tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c
61
self->orig_root = open("/", O_PATH | O_CLOEXEC);
tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c
70
self->orig_root = open("/", O_PATH | O_CLOEXEC);
tools/testing/selftests/filesystems/nsfs/iterate_mntns.c
58
self->fd_mnt_ns[i] = open("/proc/self/ns/mnt", O_RDONLY | O_CLOEXEC);
tools/testing/selftests/filesystems/overlayfs/set_layers_via_fds.c
630
layer_fds[0] = openat(fd_tmp, "upper", O_CLOEXEC | O_DIRECTORY | O_PATH);
tools/testing/selftests/filesystems/overlayfs/set_layers_via_fds.c
633
layer_fds[1] = openat(fd_tmp, "work", O_CLOEXEC | O_DIRECTORY | O_PATH);
tools/testing/selftests/filesystems/utils.c
193
setgroups_fd = open(path, O_WRONLY | O_CLOEXEC);
tools/testing/selftests/filesystems/utils.c
212
fd = open(path, O_WRONLY | O_CLOEXEC);
tools/testing/selftests/filesystems/utils.c
300
ret = open(path_ns, O_RDONLY | O_CLOEXEC | O_NOCTTY);
tools/testing/selftests/filesystems/utils.c
430
fd_userns = open(path, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/filesystems/wrappers.h
78
#define OPEN_TREE_CLOEXEC O_CLOEXEC
tools/testing/selftests/hid/hid_common.h
456
hid->uhid_fd = open(path, O_RDWR | O_CLOEXEC);
tools/testing/selftests/iommu/iommufd.c
1407
ASSERT_EQ(0, pipe2(pipefds, O_CLOEXEC));
tools/testing/selftests/iommu/iommufd_utils.h
568
.dmabuf_get = { .length = len, .open_flags = O_CLOEXEC },
tools/testing/selftests/kvm/lib/userfaultfd_util.c
137
uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
tools/testing/selftests/kvm/lib/userfaultfd_util.c
158
ret = pipe2((int *) &pipes, O_CLOEXEC | O_NONBLOCK);
tools/testing/selftests/landlock/audit_test.c
233
ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC));
tools/testing/selftests/landlock/audit_test.c
235
ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC));
tools/testing/selftests/landlock/base_test.c
227
open("/tmp", O_PATH | O_NOFOLLOW | O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/landlock/base_test.c
250
open("/tmp", O_PATH | O_NOFOLLOW | O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/landlock/base_test.c
284
fd = open("/dev/null", O_RDONLY | O_CLOEXEC);
tools/testing/selftests/landlock/base_test.c
295
fd = open("/dev/null", O_RDONLY | O_CLOEXEC);
tools/testing/selftests/landlock/base_test.c
404
open("/tmp", O_PATH | O_NOFOLLOW | O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/landlock/base_test.c
432
ASSERT_EQ(-1, open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC));
tools/testing/selftests/landlock/base_test.c
434
dir_fd = open("/tmp", O_RDONLY | O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/landlock/base_test.c
444
dir_fd = open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/landlock/base_test.c
447
dir_fd = open("/tmp", O_RDONLY | O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/landlock/base_test.c
467
dir_fd = open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/landlock/base_test.c
480
EXPECT_EQ(-1, open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC));
tools/testing/selftests/landlock/base_test.c
494
EXPECT_EQ(-1, open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC));
tools/testing/selftests/landlock/base_test.c
513
EXPECT_EQ(-1, open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC));
tools/testing/selftests/landlock/base_test.c
525
EXPECT_EQ(-1, open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC));
tools/testing/selftests/landlock/fs_test.c
2025
dst_fd = open(dst_path, O_WRONLY | O_TRUNC | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
2030
src_fd = open(src_path, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
3593
reg_fd = open(file1_s1d2, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
3597
proc_fd = open_proc_fd(_metadata, reg_fd, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
3601
proc_fd = open_proc_fd(_metadata, reg_fd, O_RDWR | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
3638
ASSERT_EQ(0, pipe2(pipe_fds, O_CLOEXEC));
tools/testing/selftests/landlock/fs_test.c
3647
proc_fd = open_proc_fd(_metadata, pipe_fds[1], O_WRONLY | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
3657
proc_fd = open_proc_fd(_metadata, pipe_fds[0], O_RDONLY | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
4176
fd = open(dir_s1d1, O_PATH | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
4195
fd = open(dir_s1d1, O_PATH | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
4273
fd = open("/dev/null", O_RDWR | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
435
fd = openat(dirfd, path, flags | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
4884
bind_s1d3_fd = open(bind_dir_s1d3, O_PATH | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
489
open(dir_s1d2, O_PATH | O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
492
ruleset_fd = open(dir_s1d1, O_PATH | O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
4990
bind_s1d3_fd = open(bind_dir_s1d3, O_PATH | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
500
ruleset_fd = open(dir_s1d1, O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
5137
bind_s1d3_fd = open(bind_dir_s1d3, O_PATH | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
517
path_beneath.parent_fd = open(dir_s1d2, O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
5280
open(TMP_DIR "/s2d1/s2d2", O_DIRECTORY | O_PATH | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
531
open(dir_s1d2, O_PATH | O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
5711
O_DIRECTORY | O_PATH | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
5714
O_DIRECTORY | O_PATH | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
5838
O_DIRECTORY | O_PATH | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
5842
open(TMP_DIR "/s3d1/s3d2", O_DIRECTORY | O_PATH | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
613
path_beneath_file.parent_fd = open(file1_s1d2, O_PATH | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
618
open(dir_s1d2, O_PATH | O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
6233
O_DIRECTORY | O_PATH | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
671
open(TMP_DIR, O_PATH | O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
6953
EXPECT_EQ(0, test_open(dev_null_path, O_RDONLY | O_CLOEXEC));
tools/testing/selftests/landlock/fs_test.c
6954
EXPECT_EQ(0, test_open(variant->file_path, O_RDONLY | O_CLOEXEC));
tools/testing/selftests/landlock/fs_test.c
6962
EXPECT_EQ(EACCES, test_open(dev_null_path, O_RDONLY | O_CLOEXEC));
tools/testing/selftests/landlock/fs_test.c
6963
EXPECT_EQ(0, test_open(variant->file_path, O_RDONLY | O_CLOEXEC));
tools/testing/selftests/landlock/fs_test.c
6974
EXPECT_EQ(EACCES, test_open(dev_null_path, O_RDONLY | O_CLOEXEC));
tools/testing/selftests/landlock/fs_test.c
6975
EXPECT_EQ(EACCES, test_open(variant->file_path, O_RDONLY | O_CLOEXEC));
tools/testing/selftests/landlock/fs_test.c
698
path_beneath.parent_fd = open(file1_s1d2, O_PATH | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
727
path_beneath.parent_fd = open(path, O_PATH | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
7613
fd = open("/dev/null", O_RDONLY | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
835
path_beneath.parent_fd = open("/proc/self/ns/mnt", O_PATH | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
908
reg_fd = open(file1_s2d2, O_RDWR | O_CLOEXEC);
tools/testing/selftests/landlock/fs_test.c
917
reg_fd = open(file1_s2d2, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/landlock/net_test.c
1645
path_beneath.parent_fd = open("/dev", O_PATH | O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/landlock/ptrace_test.c
169
ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC));
tools/testing/selftests/landlock/ptrace_test.c
170
ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC));
tools/testing/selftests/landlock/ptrace_test.c
360
ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC));
tools/testing/selftests/landlock/ptrace_test.c
361
ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC));
tools/testing/selftests/landlock/ptrace_test.c
57
fd = open(procenv_path, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/landlock/scoped_abstract_unix_test.c
185
ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_abstract_unix_test.c
186
ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_abstract_unix_test.c
317
ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_abstract_unix_test.c
318
ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_abstract_unix_test.c
427
ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_abstract_unix_test.c
442
ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_abstract_unix_test.c
646
ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_abstract_unix_test.c
647
ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_abstract_unix_test.c
812
ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_abstract_unix_test.c
88
ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_abstract_unix_test.c
997
ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_abstract_unix_test.c
998
ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_signal_test.c
188
ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_signal_test.c
189
ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_signal_test.c
277
ASSERT_EQ(0, pipe2(thread_pipe, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_signal_test.c
302
ASSERT_EQ(0, pipe2(thread_pipe, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_signal_test.c
354
ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_signal_test.c
468
ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_signal_test.c
469
ASSERT_EQ(0, pipe2(pipe_child, O_CLOEXEC));
tools/testing/selftests/landlock/scoped_signal_test.c
91
ASSERT_EQ(0, pipe2(pipe_parent, O_CLOEXEC));
tools/testing/selftests/landlock/wait-pipe-sandbox.c
119
if (open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC) >= 0) {
tools/testing/selftests/landlock/wait-pipe-sandbox.c
96
if (open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC) >= 0) {
tools/testing/selftests/memfd/fuse_test.c
262
fd = open(argv[1], O_RDONLY | O_CLOEXEC);
tools/testing/selftests/memfd/memfd_test.c
112
int fd = open("/proc/sys/vm/memfd_noexec", O_WRONLY | O_CLOEXEC);
tools/testing/selftests/memfd/memfd_test.c
127
int fd = open("/proc/sys/vm/memfd_noexec", O_WRONLY | O_CLOEXEC);
tools/testing/selftests/memfd/memfd_test.c
144
int fd = open("/proc/sys/vm/memfd_noexec", O_RDONLY | O_CLOEXEC);
tools/testing/selftests/mm/hugepage-mremap.c
68
uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
tools/testing/selftests/mm/ksm_functional_tests.c
305
uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
tools/testing/selftests/mm/ksm_functional_tests.c
333
uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
tools/testing/selftests/mm/mkdirty.c
288
uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
tools/testing/selftests/mm/pagemap_ioctl.c
97
uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK | UFFD_USER_MODE_ONLY);
tools/testing/selftests/mm/uffd-common.c
396
if (pipe2(&gopts->pipefd[cpu * 2], O_CLOEXEC | O_NONBLOCK))
tools/testing/selftests/mm/uffd-common.c
692
fd = open("/dev/userfaultfd", O_RDWR | O_CLOEXEC);
tools/testing/selftests/mm/uffd-common.h
41
#define UFFD_FLAGS (O_CLOEXEC | O_NONBLOCK | UFFD_USER_MODE_ONLY)
tools/testing/selftests/mount_setattr/mount_setattr_test.c
1109
fd = open("/dev/null", O_RDONLY | O_CLOEXEC);
tools/testing/selftests/mount_setattr/mount_setattr_test.c
1138
attr.userns_fd = open("/proc/1/ns/user", O_RDONLY | O_CLOEXEC);
tools/testing/selftests/mount_setattr/mount_setattr_test.c
1220
ret = open(path, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/mount_setattr/mount_setattr_test.c
1477
fd = open(NOSYMFOLLOW_SYMLINK, O_RDWR | O_CLOEXEC);
tools/testing/selftests/mount_setattr/mount_setattr_test.c
1501
fd = open(NOSYMFOLLOW_SYMLINK, O_RDWR | O_CLOEXEC);
tools/testing/selftests/mount_setattr/mount_setattr_test.c
1523
fd = open(NOSYMFOLLOW_SYMLINK, O_RDWR | O_CLOEXEC);
tools/testing/selftests/mount_setattr/mount_setattr_test.c
166
fd = open(path, O_WRONLY | O_CLOEXEC | O_NOCTTY | O_NOFOLLOW);
tools/testing/selftests/mount_setattr/mount_setattr_test.c
419
fd = creat(NOSYMFOLLOW_TARGET, O_RDWR | O_CLOEXEC);
tools/testing/selftests/mount_setattr/mount_setattr_test.c
626
fd = open("/mnt/A/AA/B/b", O_RDWR | O_CLOEXEC | O_CREAT | O_EXCL, 0777);
tools/testing/selftests/mount_setattr/mount_setattr_test.c
675
fd = open("/mnt/A/AA/B/b", O_RDWR | O_CLOEXEC | O_CREAT | O_EXCL, 0777);
tools/testing/selftests/mount_setattr/mount_setattr_test.c
705
dfd = open("/mnt/A/AA/B", O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/mount_setattr/mount_setattr_test.c
981
fd = open("/mnt/A", O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c
64
fd = open(path, O_WRONLY | O_CLOEXEC | O_NOCTTY | O_NOFOLLOW);
tools/testing/selftests/openat2/openat2_test.c
176
.how.flags = O_PATH | O_CLOEXEC },
tools/testing/selftests/openat2/openat2_test.c
290
fdflags |= O_CLOEXEC;
tools/testing/selftests/pid_namespace/pid_max.c
103
fd = open("/proc/sys/kernel/pid_max", O_RDWR | O_CLOEXEC | O_NOCTTY);
tools/testing/selftests/pid_namespace/pid_max.c
178
fd = open("/proc/sys/kernel/pid_max", O_RDWR | O_CLOEXEC | O_NOCTTY);
tools/testing/selftests/pid_namespace/pid_max.c
247
fd = open("/proc/sys/kernel/pid_max", O_RDWR | O_CLOEXEC | O_NOCTTY);
tools/testing/selftests/pid_namespace/pid_max.c
304
fd = open("/proc/sys/kernel/pid_max", O_RDWR | O_CLOEXEC | O_NOCTTY);
tools/testing/selftests/pid_namespace/pid_max.c
57
fd = open("/proc/sys/kernel/pid_max", O_RDWR | O_CLOEXEC | O_NOCTTY);
tools/testing/selftests/pidfd/pidfd_bind_mount.c
103
fd_pidfd_mnt = openat(-EBADF, self->template, O_RDONLY | O_NOCTTY | O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_bind_mount.c
77
pidfd = open(proc_path, O_RDONLY | O_NOCTTY | O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_file_handle_test.c
168
pidfd = open_by_handle_at(self->pidfd, fh, O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_file_handle_test.c
215
pidfd = open_by_handle_at(self->pidfd, fh, O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_file_handle_test.c
373
O_CLOEXEC |
tools/testing/selftests/pidfd/pidfd_file_handle_test.c
530
pidfd = open_by_handle_at(FD_PIDFS_ROOT, fh, O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_setns_test.c
106
proc_fd = open("/proc/self/ns", O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_setns_test.c
119
self->nsfds[i] = openat(proc_fd, info->name, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_setns_test.c
269
self->nsfds[i] = openat(proc_fd, info->name, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_setns_test.c
282
self->child_nsfds1[i] = open(p, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_setns_test.c
295
self->child_nsfds2[i] = open(p, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_setns_test.c
365
return open(path, O_RDONLY | O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_setns_test.c
82
fd = open("/proc/self/ns/time_for_children", O_RDONLY | O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_test.c
104
pidfd = open("/proc/self", O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_test.c
168
pidfd = open(buf, O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_test.c
272
pidfd = open(buf, O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_test.c
301
ret = pipe2(pipe_fds, O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_test.c
408
pidfd = open("/proc/self", O_DIRECTORY | O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_wait.c
44
pidfd = open("/proc/self", O_DIRECTORY | O_RDONLY | O_CLOEXEC);
tools/testing/selftests/pidfd/pidfd_wait.c
52
pidfd = open("/dev/null", O_RDONLY | O_CLOEXEC);
tools/testing/selftests/powerpc/tm/tm-signal-pagefault.c
148
uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
tools/testing/selftests/proc/proc-pid-vm.c
212
fd1 = open(buf, O_RDONLY|O_CLOEXEC);
tools/testing/selftests/proc/proc-pidns.c
34
int fd = open(path, O_WRONLY|O_CREAT|O_CLOEXEC, 0644);
tools/testing/selftests/proc/proc-pidns.c
49
self->host_mntns = open("/proc/self/ns/mnt", O_RDONLY|O_CLOEXEC);
tools/testing/selftests/proc/proc-pidns.c
70
self->host_pidns = open("/proc/self/ns/pid", O_RDONLY|O_CLOEXEC);
tools/testing/selftests/proc/proc-pidns.c
90
self->dummy_pidns = open("/tmp/dummy/pidns", O_RDONLY|O_CLOEXEC);
tools/testing/selftests/seccomp/seccomp_bpf.c
4186
addfd.newfd_flags = ~O_CLOEXEC;
tools/testing/selftests/seccomp/seccomp_bpf.c
4189
addfd.newfd_flags = O_CLOEXEC;
tools/testing/selftests/seccomp/seccomp_bpf.c
4333
addfd.newfd_flags = O_CLOEXEC;
tools/testing/selftests/uevent/uevent_filtering.c
200
fd = open(__DEV_FULL, O_RDWR | O_CLOEXEC);
tools/testing/selftests/x86/test_shadow_stack.c
496
uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
virt/kvm/kvm_main.c
4121
return anon_inode_getfd(name, &kvm_vcpu_fops, vcpu, O_RDWR | O_CLOEXEC);
virt/kvm/kvm_main.c
4322
fd = get_unused_fd_flags(O_CLOEXEC);
virt/kvm/kvm_main.c
4852
ret = anon_inode_getfd(ops->name, &kvm_device_fops, dev, O_RDWR | O_CLOEXEC);
virt/kvm/kvm_main.c
5129
fd = get_unused_fd_flags(O_CLOEXEC);
virt/kvm/kvm_main.c
5493
fd = get_unused_fd_flags(O_CLOEXEC);