Lines Matching refs:sarg
185 struct selarg *sarg = (struct selarg *)arg; in do_select() local
191 sarg->ret = 0; in do_select()
193 FD_COPY(&sarg->def_readfds, &readfds); in do_select()
203 nfd = select(sarg->max_fd + 1, &readfds, 0, 0, tp); in do_select()
207 sarg->ret = EBADF; in do_select()
223 for (int i = 0; i < sarg->nthreads; i++) { in do_select()
224 struct endpoint *ep = &sarg->th[i].ep; in do_select()
267 struct selarg sarg; in test_select_stress() local
326 sarg.max_fd = 0; in test_select_stress()
327 FD_ZERO(&sarg.def_readfds); in test_select_stress()
331 FD_SET(ep->fd[0], &sarg.def_readfds); in test_select_stress()
332 if (ep->fd[0] > sarg.max_fd) { in test_select_stress()
333 sarg.max_fd = ep->fd[0]; in test_select_stress()
337 sarg.th = th; in test_select_stress()
338 sarg.nthreads = nthreads; in test_select_stress()
349 sarg.ret = 0; in test_select_stress()
350 int retries = create_thread_backoff(&sarg.pth, 0, do_select, &sarg); in test_select_stress()
358 T_ASSERT_POSIX_ZERO(pthread_cancel(sarg.pth), "pthread_cancel"); in test_select_stress()
361 T_ASSERT_POSIX_ZERO(pthread_join(sarg.pth, &thret), "pthread_join"); in test_select_stress()
363 if (sarg.ret == EBADF) { in test_select_stress()
367 T_ASSERT_GE(sarg.ret, 0, "threaded do_select returned an \ in test_select_stress()
368 error: %d!", sarg.ret); in test_select_stress()