Home | History | Annotate | Download | only in examples

Lines Matching defs:fds

824 	int fds[2], flags = 1;
827 if (pipe(fds)) {
834 close(fds[0]), close(fds[1]);
837 close(fds[0]);
838 dup2(fds[1], 1);
839 close(fds[1]);
844 close(fds[1]);
845 if (ioctl(fds[0], FIONBIO, &flags) &&
846 ((flags = fcntl(fds[0], F_GETFL, 0)) < 0 ||
847 fcntl(fds[0], F_SETFL, flags | O_NONBLOCK) < 0)) {
848 close(fds[0]);
851 fprintf(stdout, "child-run=%d fd=%d\n", chpid, fds[0]), fflush(stdout);
852 return eph_new_conn(fds[0], func);
857 int fds[2], flags = 1;
860 if (pipe(fds)) {
867 close(fds[0]), close(fds[1]);
872 close(fds[0]);
873 dup2(fds[1], 1);
874 close(fds[1]);
895 close(fds[1]);
896 if (ioctl(fds[0], FIONBIO, &flags) &&
897 ((flags = fcntl(fds[0], F_GETFL, 0)) < 0 ||
898 fcntl(fds[0], F_SETFL, flags | O_NONBLOCK) < 0)) {
899 close(fds[0]);
902 fprintf(stdout, "child-run=%d fd=%d\n", chpid, fds[0]), fflush(stdout);
903 return eph_new_conn(fds[0], func);