Lines Matching refs:fd

42     void (*func)(int fd, void *cookie);
43 int fd;
51 sti->func(sti->fd, sti->cookie);
59 static void dns_service(int fd, void *cookie)
69 writex(fd, &zero, 4);
71 writex(fd, hp->h_addr, 4);
74 adb_close(fd);
83 int fd;
85 fd = adb_creat("/tmp/update", 0644);
86 if(fd < 0) {
94 if(writex(fd, buf, xfer)) break;
103 adb_close(fd);
106 fd = adb_creat("/tmp/update.begin", 0644);
107 adb_close(fd);
110 void restart_root_service(int fd, void *cookie)
117 writex(fd, buf, strlen(buf));
118 adb_close(fd);
123 writex(fd, buf, strlen(buf));
124 adb_close(fd);
130 writex(fd, buf, strlen(buf));
131 adb_close(fd);
135 void restart_tcp_service(int fd, void *cookie)
143 writex(fd, buf, strlen(buf));
144 adb_close(fd);
151 writex(fd, buf, strlen(buf));
152 adb_close(fd);
155 void restart_usb_service(int fd, void *cookie)
161 writex(fd, buf, strlen(buf));
162 adb_close(fd);
165 void reboot_service(int fd, void *arg)
188 writex(fd, buf, strlen(buf));
191 adb_close(fd);
197 static void echo_service(int fd, void *cookie)
205 r = read(fd, buf, 4096);
215 r = write(fd, p, c);
226 close(fd);
245 sti->fd = s[1];
312 int fd = adb_open(text, O_WRONLY);
313 if (fd >= 0) {
314 adb_write(fd, "0", 1);
315 adb_close(fd);
341 static void subproc_waiter_service(int fd, void *cookie)
345 D("entered. fd=%d of pid=%d\n", fd, pid);
350 D("fd=%d, post waitpid(pid=%d) status=%04x\n", fd, p, status);
363 D("shell exited fd=%d of pid=%d err=%d\n", fd, pid, errno);
366 res = writex(SHELL_EXIT_NOTIFY_FD, &fd, sizeof(fd));
367 D("notified shell exit via fd=%d for pid=%d res=%d errno=%d\n",
389 sti->fd = ret_fd;
398 D("service thread started, fd=%d pid=%d\n",ret_fd, pid);
502 static void wait_for_state(int fd, void* cookie)
511 writex(fd, "OKAY", 4);
513 sendfailmsg(fd, err);
519 adb_close(fd);
553 int fd = create_service_thread(wait_for_state, sinfo);
554 return create_local_socket(fd);