Lines Matching refs:sfd
26 int sfd[2];
32 socketpair(AF_UNIX, SOCK_STREAM, 0, sfd) < 0 ||
33 shutdown(sfd[1], SHUT_RD) < 0 ||
34 shutdown(sfd[0], SHUT_WR) < 0)
41 close(sfd[1]);
44 sfpkrd(sfd[0], buf, sizeof(buf), '\n', -1, 1) < 0)
50 close(sfd[0]);
52 write(sfd[1], msg, sizeof(msg) - 1);
56 close(sfd[0]);
58 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sfd) < 0 ||
59 shutdown(sfd[1], SHUT_RD) < 0 ||
60 shutdown(sfd[0], SHUT_WR) < 0)
62 close(sfd[0]);
63 write(sfd[1], msg, sizeof(msg) - 1);
76 int sfd[2];
83 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sfd) < 0 ||
84 shutdown(sfd[0], 1) < 0 ||
85 shutdown(sfd[1], 0) < 0)
88 dup(sfd[0]);
89 close(sfd[0]);
102 int sfd[2];
105 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sfd) < 0 ||
106 shutdown(sfd[0], 1) < 0 ||
107 shutdown(sfd[1], 0) < 0)
109 if (fstat(sfd[0], &st0) < 0 || fstat(sfd[1], &st1) < 0)
114 if (fchmod(sfd[0], S_IRUSR) < 0 ||
115 fstat(sfd[0], &st0) < 0 ||
118 if (fchmod(sfd[1], S_IWUSR) < 0 ||
119 fstat(sfd[1], &st1) < 0 ||