• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/xnu-2422.115.4/tools/tests/libMicro/

Lines Matching refs:ts

164 	tsd_t			*ts = (tsd_t *)tsd;
170 result = prepare_socketpair(ts);
173 result = prepare_localtcp(ts);
176 result = prepare_fifos(ts);
180 result = prepare_pipes(ts);
189 result = pthread_create(&ts->ts_thread, NULL, loopback, tsd);
204 ts->ts_child = pid;
214 if (write(ts->ts_out, wbuf, opts) != opts) {
217 if (readall(ts->ts_in, rbuf, opts) != opts) {
227 tsd_t *ts = (tsd_t *)tsd;
232 if (write(ts->ts_out, wbuf, opts) != opts) {
237 n = readall(ts->ts_in, rbuf, opts);
251 tsd_t *ts = (tsd_t *)tsd;
254 (void) write(ts->ts_out, wbuf, opts);
255 (void) readall(ts->ts_in, rbuf, opts);
259 (void) close(ts->ts_in2);
260 (void) close(ts->ts_out2);
261 (void) pthread_join(ts->ts_thread, NULL);
264 (void) close(ts->ts_in2);
265 (void) close(ts->ts_out2);
266 (void) waitpid(ts->ts_child, NULL, 0);
273 (void) close(ts->ts_in);
274 (void) close(ts->ts_out);
277 (void) cleanup_fifos(ts);
315 tsd_t *ts = (tsd_t *)arg;
322 n = readall(ts->ts_in2, rbuf, opts);
326 if (write(ts->ts_out2, wbuf, opts) != opts) {
335 prepare_localtcp_once(tsd_t *ts)
343 ts->ts_lsn = socket(AF_INET, SOCK_STREAM, 0);
344 if (ts->ts_lsn == -1) {
348 if (setsockopt(ts->ts_lsn, SOL_SOCKET, SO_REUSEADDR,
358 (void) memset(&ts->ts_add, 0,
360 ts->ts_add.sin_family = AF_INET;
361 ts->ts_add.sin_port = htons(j++);
362 (void) memcpy(&ts->ts_add.sin_addr.s_addr,
365 if (bind(ts->ts_lsn,
366 (struct sockaddr *)&ts->ts_add,
376 if (listen(ts->ts_lsn, 5) == -1) {
384 prepare_localtcp(tsd_t *ts)
391 if (ts->ts_once++ == 0) {
392 if (prepare_localtcp_once(ts) == -1) {
397 ts->ts_out = socket(AF_INET, SOCK_STREAM, 0);
398 if (ts->ts_out == -1) {
402 if (fcntl(ts->ts_out, F_SETFL, O_NDELAY) == -1) {
406 result = connect(ts->ts_out, (struct sockaddr *)&ts->ts_add,
412 if (fcntl(ts->ts_out, F_SETFL, 0) == -1) {
417 result = accept(ts->ts_lsn, (struct sockaddr *)&addr, &size);
421 ts->ts_out2 = result;
423 if (setsockopt(ts->ts_out, IPPROTO_TCP, TCP_NODELAY,
428 if (setsockopt(ts->ts_out2, IPPROTO_TCP, TCP_NODELAY,
434 ts->ts_in = ts->ts_out2;
436 ts->ts_in = ts->ts_out;
437 ts->ts_in2 = ts->ts_out2;
444 prepare_socketpair(tsd_t *ts)
453 ts->ts_in = s[0];
454 ts->ts_out = s[1];
456 ts->ts_in = s[0];
457 ts->ts_out = s[0];
458 ts->ts_in2 = s[1];
459 ts->ts_out2 = s[1];
466 prepare_fifos(tsd_t *ts)
477 ts->ts_in = open(path, O_RDONLY);
478 ts->ts_out = open(path, O_WRONLY);
480 ts->ts_in = open(path, O_RDONLY);
481 ts->ts_out2 = open(path, O_WRONLY);
489 ts->ts_in2 = open(path, O_RDONLY);
490 ts->ts_out = open(path, O_WRONLY);
498 cleanup_fifos(tsd_t *ts)
511 prepare_pipes(tsd_t *ts)
519 ts->ts_in = p[0];
520 ts->ts_out = p[1];
526 ts->ts_in = p[0];
527 ts->ts_out2 = p[1];
532 ts->ts_in2 = p[0];
533 ts->ts_out = p[1];