Home
last modified time | relevance | path

Searched refs:dirfd (Results 1 – 25 of 31) sorted by relevance

12

/linux/tools/perf/tests/
H A Dpmu.c66 int dirfd, file; in test_pmu_get() local
77 dirfd = open(dir, O_DIRECTORY); in test_pmu_get()
78 if (dirfd < 0) { in test_pmu_get()
84 if (mkdirat(dirfd, "perf-pmu-test", 0755) < 0) { in test_pmu_get()
88 file = openat(dirfd, "perf-pmu-test/type", O_WRONLY | O_CREAT, 0600); in test_pmu_get()
102 if (mkdirat(dirfd, "perf-pmu-test/format", 0755) < 0) { in test_pmu_get()
113 file = openat(dirfd, name, O_WRONLY | O_CREAT, 0600); in test_pmu_get()
128 if (mkdirat(dirfd, "perf-pmu-test/events", 0755) < 0) { in test_pmu_get()
132 file = openat(dirfd, "perf-pmu-test/events/test-event", O_WRONLY | O_CREAT, 0600); in test_pmu_get()
146 pmu = perf_pmus__add_test_pmu(dirfd, "perf-pmu-test"); in test_pmu_get()
[all …]
H A Dbuiltin-test.c183 if (fd <= 3 || fd == dirfd(dir)) in close_parent_fds()
213 if (fd <= 3 || fd == dirfd(dir)) in check_leaks()
217 len = readlinkat(dirfd(dir), ent->d_name, path, sizeof(path)); in check_leaks()
/linux/tools/include/nolibc/
H A Dfcntl.h22 int sys_openat(int dirfd, const char *path, int flags, mode_t mode) in sys_openat() argument
24 return my_syscall4(__NR_openat, dirfd, path, flags, mode); in sys_openat()
28 int openat(int dirfd, const char *path, int flags, ...) in openat() argument
40 return __sysret(sys_openat(dirfd, path, flags, mode)); in openat()
/linux/tools/testing/selftests/proc/
H A Dread.c45 fd = openat(dirfd(d), filename, O_RDONLY|O_NONBLOCK); in f_reg()
60 fd = openat(dirfd(d), filename, O_WRONLY); in f_reg_write()
73 rv = readlinkat(dirfd(d), filename, buf, sizeof(buf)); in f_lnk()
109 fd = openat(dirfd(d), de->d_name, O_DIRECTORY|O_RDONLY); in f()
137 if (fstatfs(dirfd(d), &sfs) == -1) { in main()
H A Dfd-003-kthread.c116 static inline int sys_statx(int dirfd, const char *pathname, int flags, in sys_statx() argument
119 return syscall(SYS_statx, dirfd, pathname, flags, mask, stx); in sys_statx()
H A Dfd-001-lookup.c136 if (fd == dirfd(d)) in main()
H A Dproc-pid-vm.c56 static inline long sys_execveat(int dirfd, const char *pathname, char **argv, char **envp, int flag… in sys_execveat() argument
58 return syscall(SYS_execveat, dirfd, pathname, argv, envp, flags); in sys_execveat()
/linux/tools/perf/arch/x86/util/
H A Dintel-pt.c192 int dirfd; in intel_pt_default_config() local
194 dirfd = perf_pmu__event_source_devices_fd(); in intel_pt_default_config()
198 if (perf_pmu__scan_file_at(intel_pt_pmu, dirfd, "caps/mtc", "%d", in intel_pt_default_config()
203 if (perf_pmu__scan_file_at(intel_pt_pmu, dirfd, "caps/mtc_periods", "%x", in intel_pt_default_config()
213 if (perf_pmu__scan_file_at(intel_pt_pmu, dirfd, "caps/psb_cyc", "%d", in intel_pt_default_config()
218 if (perf_pmu__scan_file_at(intel_pt_pmu, dirfd, "caps/psb_periods", "%x", in intel_pt_default_config()
228 if (perf_pmu__scan_file_at(intel_pt_pmu, dirfd, "format/pt", "%c", &c) == 1 && in intel_pt_default_config()
229 perf_pmu__scan_file_at(intel_pt_pmu, dirfd, "format/branch", "%c", &c) == 1) in intel_pt_default_config()
236 close(dirfd); in intel_pt_default_config()
491 static int intel_pt_val_config_term(struct perf_pmu *intel_pt_pmu, int dirfd, in intel_pt_val_config_term() argument
[all …]
/linux/tools/testing/selftests/openat2/
H A Drename_attack_test.c55 pid_t spawn_attack(int dirfd, char *a, char *b) in spawn_attack() argument
66 renameat2(dirfd, a, dirfd, b, RENAME_EXCHANGE); in spawn_attack()
/linux/tools/perf/util/
H A Dtp_pmu.c42 if (evt_dir.dirfd < 0) { in tp_pmu__for_each_tp_event()
60 close(evt_dir.dirfd); in tp_pmu__for_each_tp_event()
75 if (events_dir.dirfd < 0) { in tp_pmu__for_each_tp_sys()
92 close(events_dir.dirfd); in tp_pmu__for_each_tp_sys()
H A Dpmu.c215 static int perf_pmu__format_parse(struct perf_pmu *pmu, int dirfd, bool eager_load) in perf_pmu__format_parse() argument
221 io_dir__init(&format_dir, dirfd); in perf_pmu__format_parse()
238 int fd = openat(dirfd, name, O_RDONLY); in perf_pmu__format_parse()
254 close(format_dir.dirfd); in perf_pmu__format_parse()
263 static int pmu_format(struct perf_pmu *pmu, int dirfd, const char *name, bool eager_load) in pmu_format() argument
267 fd = perf_pmu__pathname_fd(dirfd, name, "format", O_DIRECTORY); in pmu_format()
834 static struct perf_cpu_map *pmu_cpumask(int dirfd, const char *pmu_name, bool is_core) in pmu_cpumask() argument
851 io.fd = perf_pmu__pathname_fd(dirfd, pmu_name, *template, O_RDONLY); in pmu_cpumask()
871 static bool pmu_is_uncore(int dirfd, const char *name) in pmu_is_uncore() argument
875 fd = perf_pmu__pathname_fd(dirfd, name, "cpumask", O_PATH); in pmu_is_uncore()
[all …]
H A Dpmu.h278 FILE *perf_pmu__open_file_at(const struct perf_pmu *pmu, int dirfd, const char *name);
282 int perf_pmu__scan_file_at(const struct perf_pmu *pmu, int dirfd, const char *name,
312 int perf_pmu__pathname_fd(int dirfd, const char *pmu_name, const char *filename, int flags);
315 struct perf_pmu *perf_pmu__lookup(struct list_head *pmus, int dirfd, const char *lookup_name,
H A Dpmus.c149 int dirfd; in perf_pmus__find() local
169 dirfd = perf_pmu__event_source_devices_fd(); in perf_pmus__find()
170 pmu = perf_pmu__lookup(core_pmu ? &core_pmus : &other_pmus, dirfd, name, in perf_pmus__find()
172 close(dirfd); in perf_pmus__find()
199 static struct perf_pmu *perf_pmu__find2(int dirfd, const char *name) in perf_pmu__find2() argument
220 return perf_pmu__lookup(core_pmu ? &core_pmus : &other_pmus, dirfd, name, in perf_pmu__find2()
H A Dhwmon_pmu.c250 if (dir.dirfd < 0) in hwmon_pmu__read_events()
286 int fd = openat(dir.dirfd, ent->d_name, O_RDONLY); in hwmon_pmu__read_events()
341 close(dir.dirfd); in hwmon_pmu__read_events()
718 if (class_hwmon_dir.dirfd < 0) in perf_pmus__read_hwmon_pmus()
752 close(class_hwmon_dir.dirfd); in perf_pmus__read_hwmon_pmus()
H A Ddrm_pmu.c504 dirfd(proc_dir), proc_entry->d_name, in for_each_drm_fdinfo()
/linux/samples/check-exec/
H A Dinc.c27 static int sys_execveat(int dirfd, const char *pathname, char *const argv[], in sys_execveat() argument
30 return syscall(__NR_execveat, dirfd, pathname, argv, envp, flags); in sys_execveat()
/linux/tools/testing/selftests/bpf/
H A Dcgroup_helpers.c475 int dirfd, err, flags, mount_id, fhsize; in get_cgroup_id_from_path()
483 dirfd = AT_FDCWD; in get_cgroup_id_from_path()
491 err = name_to_handle_at(dirfd, cgroup_workdir, fhp, &mount_id, flags); in get_cgroup_id_from_path()
503 err = name_to_handle_at(dirfd, cgroup_workdir, fhp2, &mount_id, flags); in get_cgroup_id()
455 int dirfd, err, flags, mount_id, fhsize; get_cgroup_id_from_path() local
/linux/tools/testing/selftests/pidfd/
H A Dpidfd.h303 static inline int sys_execveat(int dirfd, const char *pathname, in sys_execveat() argument
307 return syscall(__NR_execveat, dirfd, pathname, argv, envp, flags); in sys_execveat()
/linux/tools/testing/selftests/iommu/
H A Diommufd_fail_nth.c68 if (writeat(dirfd(debugfs), "failslab/ignore-gfp-wait", "N")) in setup_fault_injection()
70 writeat(dirfd(debugfs), "fail_page_alloc/ignore-gfp-wait", "N"); in setup_fault_injection()
71 writeat(dirfd(debugfs), "fail_page_alloc/ignore-gfp-highmem", "N"); in setup_fault_injection()
81 writeat(dirfd(debugfs), fn, "0"); in setup_fault_injection()
/linux/fs/
H A Dfsopen.c456 param.dirfd = aux; in SYSCALL_DEFINE5()
465 param.dirfd = aux; in SYSCALL_DEFINE5()
/linux/tools/testing/selftests/landlock/
H A Dfs_test.c63 static int sys_execveat(int dirfd, const char *pathname, char *const argv[], in sys_execveat() argument
66 return syscall(__NR_execveat, dirfd, pathname, argv, envp, flags); in sys_execveat()
429 static int test_open_rel(const int dirfd, const char *const path, in test_open_rel() argument
435 fd = openat(dirfd, path, flags | O_CLOEXEC); in test_open_rel()
1907 int dirfd, ruleset_fd; in test_relative_path() local
1937 dirfd = open(dir_s1d2, O_DIRECTORY); in test_relative_path()
1938 ASSERT_LE(0, dirfd); in test_relative_path()
1942 dirfd = AT_FDCWD; in test_relative_path()
1950 dirfd = AT_FDCWD; in test_relative_path()
1958 dirfd = AT_FDCWD; in test_relative_path()
[all …]
/linux/tools/testing/selftests/exec/
H A Dcheck-exec.c35 static int sys_execveat(int dirfd, const char *pathname, char *const argv[], in sys_execveat() argument
38 return syscall(__NR_execveat, dirfd, pathname, argv, envp, flags); in sys_execveat()
/linux/tools/power/cpupower/lib/
H A Dpowercap.c225 if (fstatat(dirfd(zone_dir), dent->d_name, &st, 0) < 0) in powercap_read_zone()
/linux/include/linux/
H A Dfs_context.h73 int dirfd; member
/linux/Documentation/trace/
H A Deprobetrace.rst167 int sys_openat(int dirfd, const char *path, int flags, mode_t mode)
169 return my_syscall4(__NR_openat, dirfd, path, flags, mode);

12