Home
last modified time | relevance | path

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

/tools/testing/selftests/proc/
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()
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()
Dfd-001-lookup.c136 if (fd == dirfd(d)) in main()
Dproc-pid-vm.c51 static inline long sys_execveat(int dirfd, const char *pathname, char **argv, char **envp, int flag… in sys_execveat() argument
53 return syscall(SYS_execveat, dirfd, pathname, argv, envp, flags); in sys_execveat()
/tools/perf/arch/x86/util/
Dpmu.c76 int fd, dirfd; in setup_pmu_alias_list() local
84 dirfd = perf_pmu__event_source_devices_fd(); in setup_pmu_alias_list()
85 if (dirfd < 0) in setup_pmu_alias_list()
88 dir = fdopendir(dirfd); in setup_pmu_alias_list()
97 fd = perf_pmu__pathname_fd(dirfd, dent->d_name, "alias", O_RDONLY); in setup_pmu_alias_list()
Dintel-pt.c194 int dirfd; in intel_pt_default_config() local
196 dirfd = perf_pmu__event_source_devices_fd(); in intel_pt_default_config()
200 if (perf_pmu__scan_file_at(intel_pt_pmu, dirfd, "caps/mtc", "%d", in intel_pt_default_config()
205 if (perf_pmu__scan_file_at(intel_pt_pmu, dirfd, "caps/mtc_periods", "%x", in intel_pt_default_config()
215 if (perf_pmu__scan_file_at(intel_pt_pmu, dirfd, "caps/psb_cyc", "%d", in intel_pt_default_config()
220 if (perf_pmu__scan_file_at(intel_pt_pmu, dirfd, "caps/psb_periods", "%x", in intel_pt_default_config()
230 if (perf_pmu__scan_file_at(intel_pt_pmu, dirfd, "format/pt", "%c", &c) == 1 && in intel_pt_default_config()
231 perf_pmu__scan_file_at(intel_pt_pmu, dirfd, "format/branch", "%c", &c) == 1) in intel_pt_default_config()
238 close(dirfd); in intel_pt_default_config()
496 static int intel_pt_val_config_term(struct perf_pmu *intel_pt_pmu, int dirfd, in intel_pt_val_config_term() argument
[all …]
/tools/perf/util/
Dpmu.h208 int perf_pmu__format_parse(struct perf_pmu *pmu, int dirfd, bool eager_load);
228 FILE *perf_pmu__open_file_at(struct perf_pmu *pmu, int dirfd, const char *name);
231 int perf_pmu__scan_file_at(struct perf_pmu *pmu, int dirfd, const char *name,
265 int perf_pmu__pathname_fd(int dirfd, const char *pmu_name, const char *filename, int flags);
267 struct perf_pmu *perf_pmu__lookup(struct list_head *pmus, int dirfd, const char *lookup_name);
Dpmu.c197 int perf_pmu__format_parse(struct perf_pmu *pmu, int dirfd, bool eager_load) in perf_pmu__format_parse() argument
203 format_dir = fdopendir(dirfd); in perf_pmu__format_parse()
222 int fd = openat(dirfd, name, O_RDONLY); in perf_pmu__format_parse()
247 static int pmu_format(struct perf_pmu *pmu, int dirfd, const char *name) in pmu_format() argument
251 fd = perf_pmu__pathname_fd(dirfd, name, "format", O_DIRECTORY); in pmu_format()
727 static struct perf_cpu_map *pmu_cpumask(int dirfd, const char *name, bool is_core) in pmu_cpumask() argument
742 file = perf_pmu__open_file_at(&pmu, dirfd, *template); in pmu_cpumask()
755 static bool pmu_is_uncore(int dirfd, const char *name) in pmu_is_uncore() argument
759 fd = perf_pmu__pathname_fd(dirfd, name, "cpumask", O_PATH); in pmu_is_uncore()
1020 static int pmu_max_precise(int dirfd, struct perf_pmu *pmu) in pmu_max_precise() argument
[all …]
Dpmus.c104 int dirfd; in perf_pmus__find() local
123 dirfd = perf_pmu__event_source_devices_fd(); in perf_pmus__find()
124 pmu = perf_pmu__lookup(core_pmu ? &core_pmus : &other_pmus, dirfd, name); in perf_pmus__find()
125 close(dirfd); in perf_pmus__find()
130 static struct perf_pmu *perf_pmu__find2(int dirfd, const char *name) in perf_pmu__find2() argument
151 return perf_pmu__lookup(core_pmu ? &core_pmus : &other_pmus, dirfd, name); in perf_pmu__find2()
/tools/testing/selftests/openat2/
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()
/tools/testing/selftests/bpf/
Dcgroup_helpers.c407 int dirfd, err, flags, mount_id, fhsize; in get_cgroup_id() local
418 dirfd = AT_FDCWD; in get_cgroup_id()
426 err = name_to_handle_at(dirfd, cgroup_workdir, fhp, &mount_id, flags); in get_cgroup_id()
438 err = name_to_handle_at(dirfd, cgroup_workdir, fhp2, &mount_id, flags); in get_cgroup_id()
/tools/testing/selftests/iommu/
Diommufd_fail_nth.c65 if (writeat(dirfd(debugfs), "failslab/ignore-gfp-wait", "N")) in setup_fault_injection()
67 writeat(dirfd(debugfs), "fail_page_alloc/ignore-gfp-wait", "N"); in setup_fault_injection()
68 writeat(dirfd(debugfs), "fail_page_alloc/ignore-gfp-highmem", "N"); in setup_fault_injection()
78 writeat(dirfd(debugfs), fn, "0"); in setup_fault_injection()
/tools/testing/selftests/landlock/
Dfs_test.c382 static int test_open_rel(const int dirfd, const char *const path, in test_open_rel() argument
388 fd = openat(dirfd, path, flags | O_CLOEXEC); in test_open_rel()
1706 int dirfd, ruleset_fd; in test_relative_path() local
1736 dirfd = open(dir_s1d2, O_DIRECTORY); in test_relative_path()
1737 ASSERT_LE(0, dirfd); in test_relative_path()
1741 dirfd = AT_FDCWD; in test_relative_path()
1749 dirfd = AT_FDCWD; in test_relative_path()
1757 dirfd = AT_FDCWD; in test_relative_path()
1762 test_open_rel(dirfd, "..", O_RDONLY)); in test_relative_path()
1763 ASSERT_EQ(0, test_open_rel(dirfd, ".", O_RDONLY)); in test_relative_path()
[all …]
/tools/testing/selftests/filesystems/fuse/
Dbpf_loader.c243 int s_openat(int dirfd, struct s pathname, int flags, ...) in s_openat() argument
255 res = openat(dirfd, pathname.s, flags, va_arg(ap, mode_t)); in s_openat()
257 res = openat(dirfd, pathname.s, flags); in s_openat()
Dtest_fuse.h53 int s_openat(int dirfd, struct s pathname, int flags, ...);
/tools/power/cpupower/lib/
Dpowercap.c217 if (fstatat(dirfd(zone_dir), dent->d_name, &st, 0) < 0) in powercap_read_zone()