Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 35) sorted by relevance

12

/samples/timers/
A Dhpet_example.c82 int fd; in hpet_open_close() local
90 if (fd < 0) in hpet_open_close()
93 close(fd); in hpet_open_close()
102 int fd; in hpet_info() local
110 if (fd < 0) { in hpet_info()
126 close(fd); in hpet_info()
151 if (fd < 0) { in hpet_poll()
178 pfd.fd = fd; in hpet_poll()
209 close(fd); in hpet_poll()
231 fd = -1; in hpet_fasync()
[all …]
/samples/bpf/
A Dfds_example.c80 int fd, ret; in bpf_do_map() local
86 assert(fd > 0); in bpf_do_map()
88 ret = bpf_obj_pin(fd, file); in bpf_do_map()
92 fd = bpf_obj_get(file); in bpf_do_map()
94 assert(fd > 0); in bpf_do_map()
114 int fd, sock, ret; in bpf_do_prog() local
119 assert(fd > 0); in bpf_do_prog()
121 ret = bpf_obj_pin(fd, file); in bpf_do_prog()
125 fd = bpf_obj_get(file); in bpf_do_prog()
127 assert(fd > 0); in bpf_do_prog()
[all …]
A Dtask_fd_query_user.c50 int fd, ret; in bpf_find_probe_type() local
55 fd = open(buf, O_RDONLY); in bpf_find_probe_type()
56 CHECK_PERROR_RET(fd < 0); in bpf_find_probe_type()
58 ret = read(fd, buf, sizeof(buf)); in bpf_find_probe_type()
59 close(fd); in bpf_find_probe_type()
72 int fd, ret; in bpf_get_retprobe_bit() local
77 fd = open(buf, O_RDONLY); in bpf_get_retprobe_bit()
78 CHECK_PERROR_RET(fd < 0); in bpf_get_retprobe_bit()
81 close(fd); in bpf_get_retprobe_bit()
132 int fd, err = -1; in test_nondebug_fs_kuprobe_common() local
[all …]
A Dcpustat_user.c155 int len, fd; in cpu_stat_inject_cpu_frequency_event() local
157 fd = open(CPUFREQ_MAX_SYSFS_PATH, O_WRONLY); in cpu_stat_inject_cpu_frequency_event()
158 if (fd < 0) { in cpu_stat_inject_cpu_frequency_event()
160 return fd; in cpu_stat_inject_cpu_frequency_event()
163 len = write(fd, CPUFREQ_LOWEST_FREQ, strlen(CPUFREQ_LOWEST_FREQ)); in cpu_stat_inject_cpu_frequency_event()
169 len = write(fd, CPUFREQ_HIGHEST_FREQ, strlen(CPUFREQ_HIGHEST_FREQ)); in cpu_stat_inject_cpu_frequency_event()
176 close(fd); in cpu_stat_inject_cpu_frequency_event()
A Dtracex3_user.c17 static void clear_stats(int fd) in clear_stats() argument
25 bpf_map_update_elem(fd, &key, values, BPF_ANY); in clear_stats()
74 static void print_hist(int fd) in print_hist() argument
86 bpf_map_lookup_elem(fd, &key, values); in print_hist()
95 clear_stats(fd); in print_hist()
A Dtracex5_user.c40 int key, fd, progs_fd; in main() local
83 fd = bpf_program__fd(prog); in main()
84 bpf_map_update_elem(progs_fd, &key, &fd, BPF_ANY); in main()
A Dtracex4_user.c28 static void print_old_objects(int fd) in print_old_objects() argument
37 while (bpf_map_get_next_key(fd, &key, &next_key) == 0) { in print_old_objects()
38 bpf_map_lookup_elem(fd, &next_key, &v); in print_old_objects()
A Dsyscall_tp_user.c50 int map0_fds[nr_tests], map1_fds[nr_tests], fd, i, j = 0; in test() local
109 fd = open(filename, O_RDONLY); in test()
110 if (fd < 0) { in test()
114 close(fd); in test()
A Dsockex3_user.c27 int i, sock, fd, main_prog_fd, hash_map_fd; in main() local
56 fd = bpf_program__fd(prog); in main()
59 main_prog_fd = fd; in main()
A Doffwaketime_user.c77 static void print_stacks(int fd) in print_stacks() argument
82 while (bpf_map_get_next_key(fd, &key, &next_key) == 0) { in print_stacks()
83 bpf_map_lookup_elem(fd, &next_key, &value); in print_stacks()
A Dibumad_user.c34 static void dump_counts(int fd) in dump_counts() argument
40 if (bpf_map_lookup_elem(fd, &key, &value)) { in dump_counts()
A Dsampleip_user.c89 static void print_ip_map(int fd) in print_ip_map() argument
100 while (bpf_map_get_next_key(fd, &key, &next_key) == 0) { in print_ip_map()
101 bpf_map_lookup_elem(fd, &next_key, &value); in print_ip_map()
A Dlathist_user.c61 static void get_data(int fd) in get_data() argument
72 bpf_map_lookup_elem(fd, &key, &value); in get_data()
A Dtrace_event_user.c105 int error = 1, fd = map_fd[0], stack_map = map_fd[1]; in print_stacks() local
108 while (bpf_map_get_next_key(fd, &key, &next_key) == 0) { in print_stacks()
109 bpf_map_lookup_elem(fd, &next_key, &value); in print_stacks()
111 bpf_map_delete_elem(fd, &next_key); in print_stacks()
/samples/uhid/
A Duhid-example.c201 uhid_write(fd, &ev); in destroy()
225 static int event(int fd) in event() argument
319 ret = send_event(fd); in keyboard()
389 int fd; in main() local
417 if (fd < 0) { in main()
423 ret = create(fd); in main()
425 close(fd); in main()
431 pfds[1].fd = fd; in main()
451 ret = keyboard(fd); in main()
456 ret = event(fd); in main()
[all …]
/samples/hidraw/
A Dhid-example.c45 int fd; in main() local
57 fd = open(device, O_RDWR|O_NONBLOCK); in main()
59 if (fd < 0) { in main()
77 res = ioctl(fd, HIDIOCGRDESC, &rpt_desc); in main()
88 res = ioctl(fd, HIDIOCGRAWNAME(256), buf); in main()
95 res = ioctl(fd, HIDIOCGRAWPHYS(256), buf); in main()
102 res = ioctl(fd, HIDIOCGRAWINFO, &info); in main()
118 res = ioctl(fd, HIDIOCSFEATURE(4), buf); in main()
140 res = write(fd, buf, 2); in main()
149 res = read(fd, buf, 16); in main()
[all …]
/samples/watchdog/
A Dwatchdog-simple.c9 int fd = open("/dev/watchdog", O_WRONLY); in main() local
11 if (fd == -1) { in main()
16 ret = write(fd, "\0", 1); in main()
23 close(fd); in main()
/samples/watch_queue/
A Dwatch_test.c64 static void consumer(int fd) in consumer() argument
74 buf_len = read(fd, buffer, sizeof(buffer)); in consumer()
156 int pipefd[2], fd; in main() local
162 fd = pipefd[0]; in main()
164 if (ioctl(fd, IOC_WATCH_QUEUE_SET_SIZE, BUF_SIZE) == -1) { in main()
169 if (ioctl(fd, IOC_WATCH_QUEUE_SET_FILTER, &filter) == -1) { in main()
174 if (keyctl_watch_key(KEY_SPEC_SESSION_KEYRING, fd, 0x01) == -1) { in main()
179 if (keyctl_watch_key(KEY_SPEC_USER_KEYRING, fd, 0x02) == -1) { in main()
184 consumer(fd); in main()
/samples/vfs/
A Dtest-fsmount.c20 static void check_messages(int fd) in check_messages() argument
28 n = read(fd, buf, sizeof(buf)); in check_messages()
50 void mount_error(int fd, const char *s) in mount_error() argument
52 check_messages(fd); in mount_error()
97 #define E_fsconfig(fd, cmd, key, val, aux) \ argument
99 if (fsconfig(fd, cmd, key, val, aux) == -1) \
100 mount_error(fd, key ?: "create"); \
/samples/binderfs/
A Dbinderfs_example.c20 int fd, ret, saved_errno; in main() local
53 fd = open("/dev/binderfs/binder-control", O_RDONLY | O_CLOEXEC); in main()
54 if (fd < 0) { in main()
60 ret = ioctl(fd, BINDER_CTL_ADD, &device); in main()
62 close(fd); in main()
/samples/fanotify/
A Dfs-monitor.c75 if (event->fd != FAN_NOFD) { in handle_notifications()
121 int fd; in main() local
130 fd = fanotify_init(FAN_CLASS_NOTIF|FAN_REPORT_FID, O_RDONLY); in main()
131 if (fd < 0) in main()
134 if (fanotify_mark(fd, FAN_MARK_ADD|FAN_MARK_FILESYSTEM, in main()
140 int n = read(fd, buffer, BUFSIZ); in main()
/samples/hid/
A Dhid_mouse.c58 int fd; in get_hid_id() local
63 fd = open(uevent, O_RDONLY | O_NONBLOCK); in get_hid_id()
64 if (fd < 0) in get_hid_id()
67 close(fd); in get_hid_id()
A Dhid_surface_dial.c71 int fd; in get_hid_id() local
76 fd = open(uevent, O_RDONLY | O_NONBLOCK); in get_hid_id()
77 if (fd < 0) in get_hid_id()
80 close(fd); in get_hid_id()
/samples/mei/
A Dmei-amt-version.c98 int fd; member
103 if (cl->fd != -1) in mei_deinit()
104 close(cl->fd); in mei_deinit()
105 cl->fd = -1; in mei_deinit()
120 me->fd = open("/dev/mei0", O_RDWR); in mei_init()
121 if (me->fd == -1) { in mei_init()
167 FD_SET(me->fd, &set); in mei_recv_msg()
168 rc = select(me->fd + 1, &set, NULL, NULL, &tv); in mei_recv_msg()
169 if (rc > 0 && FD_ISSET(me->fd, &set)) { in mei_recv_msg()
182 rc = read(me->fd, buffer, len); in mei_recv_msg()
[all …]
/samples/user_events/
A Dexample.c21 static int event_reg(int fd, const char *command, int *write, int *enabled) in event_reg() argument
31 if (ioctl(fd, DIAG_IOCSREG, &reg) == -1) in event_reg()

Completed in 32 milliseconds

12