Home
last modified time | relevance | path

Searched refs:tmp_fd (Results 1 – 4 of 4) sorted by relevance

/linux/tools/testing/selftests/bpf/prog_tests/
H A Dcgroup_xattr.c26 int tmp_fd, parent_cgroup_fd = -1, child_cgroup_fd = -1; in test_read_cgroup_xattr() local
52 tmp_fd = open(TMP_FILE, O_RDONLY | O_CREAT); in test_read_cgroup_xattr()
53 ASSERT_OK_FD(tmp_fd, "open tmp file"); in test_read_cgroup_xattr()
54 close(tmp_fd); in test_read_cgroup_xattr()
H A Dmmap.c22 int err, duration = 0, i, data_map_fd, data_map_id, tmp_fd, rdmap_fd; in test_mmap() local
272 tmp_fd = bpf_map_get_fd_by_id(data_map_id); in test_mmap()
273 if (CHECK(tmp_fd < 0, "get_map_by_id", "failed %d\n", errno)) { in test_mmap()
277 close(tmp_fd); in test_mmap()
291 tmp_fd = bpf_map_get_fd_by_id(data_map_id); in test_mmap()
292 if (CHECK(tmp_fd >= 0, "get_map_by_id_after", in test_mmap()
293 "unexpectedly succeeded %d\n", tmp_fd)) { in test_mmap()
294 close(tmp_fd); in test_mmap()
/linux/tools/lib/bpf/
H A Dlibbpf_internal.h679 /* Point *fixed_fd* to the same file that *tmp_fd* points to.
680 * Regardless of success, *tmp_fd* is closed.
683 static inline int reuse_fd(int fixed_fd, int tmp_fd) in reuse_fd() argument
687 err = sys_dup3(tmp_fd, fixed_fd, O_CLOEXEC); in reuse_fd()
689 close(tmp_fd); /* clean up temporary FD */ in reuse_fd()
/linux/tools/perf/
H A Dbuiltin-inject.c85 int tmp_fd; member
1045 ssize_t ret = writen(gs->tmp_fd, buf, sz); in guest_session__output_bytes()
1472 gs->tmp_fd = mkstemp(gs->tmp_file_name); in guest_session__start()
1473 if (gs->tmp_fd < 0) in guest_session__start()
1487 if (lseek(gs->tmp_fd, 0, SEEK_SET)) in guest_session__start()
1515 if (gs->tmp_fd >= 0) in guest_session__exit()
1516 close(gs->tmp_fd); in guest_session__exit()
1585 ret = readn(gs->tmp_fd, buf, hdr_sz); in guest_session__fetch()
1597 ret = readn(gs->tmp_fd, buf, hdr->size - hdr_sz); in guest_session__fetch()