Lines Matching refs:fd
18 int ret, zero = 0, fd = -1;
37 fd = bpf_map_get_fd_by_id(info_m.id);
38 if (!ASSERT_LT(fd, 0, "bpf_map_get_fd_by_id"))
41 fd = bpf_map_get_fd_by_id_opts(info_m.id, NULL);
42 if (!ASSERT_LT(fd, 0, "bpf_map_get_fd_by_id_opts"))
45 fd = bpf_map_get_fd_by_id_opts(info_m.id, &fd_opts_rdonly);
46 if (!ASSERT_GE(fd, 0, "bpf_map_get_fd_by_id_opts"))
49 /* Map lookup should work with read-only fd. */
50 ret = bpf_map_lookup_elem(fd, &zero, &value);
57 /* Map update should not work with read-only fd. */
58 ret = bpf_map_update_elem(fd, &zero, &len, BPF_ANY);
62 /* Map update should work with read-write fd. */
68 /* Prog get fd with opts set should not work (no kernel support). */
73 /* Link get fd with opts set should not work (no kernel support). */
78 /* BTF get fd with opts set should not work (no kernel support). */
83 if (fd >= 0)
84 close(fd);