Lines Matching full:fd
37 /* For Zephyr, keep max number of fd's in sync with max poll() capacity */
56 static void setblocking(int fd, bool val) in setblocking() argument
60 fl = fcntl(fd, F_GETFL, 0); in setblocking()
71 res = fcntl(fd, F_SETFL, fl); in setblocking()
77 int pollfds_add(int fd) in pollfds_add() argument
84 if (pollfds[i].fd < 0) { in pollfds_add()
93 pollfds[i].fd = fd; in pollfds_add()
99 void pollfds_del(int fd) in pollfds_del() argument
102 if (pollfds[i].fd == fd) { in pollfds_del()
103 pollfds[i].fd = -1; in pollfds_del()
199 int fd = pollfds[i].fd; in main() local
202 int client = accept(fd, (struct sockaddr *)&client_addr, in main()
212 printf("Connection #%d from %s fd=%d\n", counter++, in main()
227 int len = recv(fd, buf, sizeof(buf), 0); in main()
233 pollfds_del(fd); in main()
234 close(fd); in main()
235 printf("Connection fd=%d closed\n", fd); in main()
246 setblocking(fd, true); in main()
249 out_len = send(fd, p, len, 0); in main()
259 setblocking(fd, false); in main()