Lines Matching +full:cs +full:- +full:setup
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
41 #include <atf-c.h>
101 int ss, ss2, cs, rc;
109 /* Server setup. */
128 cs = socket(PF_INET, SOCK_STREAM, 0);
129 ATF_CHECK(cs >= 0);
130 rc = connect(cs, (struct sockaddr *)&sin, sizeof(sin));
143 rc = close(cs);
148 * Need non-zero timeout to wait for the FIN to arrive and trigger the
164 int ss, ss2, cs, rc;
173 /* Server setup. */
192 cs = socket(PF_INET, SOCK_STREAM, 0);
193 ATF_CHECK(cs >= 0);
194 rc = connect(cs, (struct sockaddr *)&sin, sizeof(sin));
207 rc = write(cs, "xx", 2);
220 rc = close(cs);
224 * Server sees Linux-style POLLRDHUP. Note that this is the case even
232 * which is why we need a non-zero timeout here.
249 int ss, cs, rc;
256 /* Server setup. */
273 cs = socket(PF_INET, SOCK_STREAM, 0);
274 ATF_CHECK(cs >= 0);
275 rc = connect(cs, (struct sockaddr *)&sin, sizeof(sin));
277 rc = shutdown(cs, SHUT_RDWR);
281 rc = connect(cs, (struct sockaddr *)&sin, sizeof(sin));
282 ATF_CHECK_EQ(-1, rc);
285 rc = close(cs);
308 -1);
315 -1);
322 -1);
329 -1);
355 ATF_REQUIRE(child != -1);
363 if (seteuid(passwd->pw_uid) != 0)
367 s = socket(sa->sa_family, type, 0);
370 if (bind(s, sa, sa->sa_len) == 0)
379 if (bind(s, sa, sa->sa_len) == 0)
472 * Multi-binding is only allowed when both
485 * Multi-binding is only allowed when both
546 error = bind(sd[0], sinp, sinp->sa_len);
551 error = getsockname(sd[0], sinp, &(socklen_t){ sinp->sa_len });
554 error = connect(sd[1], sinp, sinp->sa_len);