Lines Matching refs:sarg
179 struct selarg *sarg = (struct selarg *)arg; in do_select() local
185 sarg->ret = 0; in do_select()
187 FD_COPY(&sarg->def_readfds, &readfds); in do_select()
197 nfd = select(sarg->max_fd + 1, &readfds, 0, 0, tp); in do_select()
201 sarg->ret = EBADF; in do_select()
217 for (int i = 0; i < sarg->nthreads; i++) { in do_select()
218 struct endpoint *ep = &sarg->th[i].ep; in do_select()
236 struct selarg sarg; in test_select_stress() local
298 sarg.max_fd = 0; in test_select_stress()
299 FD_ZERO(&sarg.def_readfds); in test_select_stress()
303 FD_SET(ep->fd[0], &sarg.def_readfds); in test_select_stress()
304 if (ep->fd[0] > sarg.max_fd) { in test_select_stress()
305 sarg.max_fd = ep->fd[0]; in test_select_stress()
309 sarg.th = th; in test_select_stress()
310 sarg.nthreads = nthreads; in test_select_stress()
321 sarg.ret = 0; in test_select_stress()
324 T_ASSERT_POSIX_ZERO(pthread_create(&sarg.pth, 0, do_select, &sarg), in test_select_stress()
329 T_ASSERT_POSIX_ZERO(pthread_cancel(sarg.pth), "pthread_cancel"); in test_select_stress()
332 T_ASSERT_POSIX_ZERO(pthread_join(sarg.pth, &thret), "pthread_join"); in test_select_stress()
334 if (sarg.ret == EBADF) { in test_select_stress()
338 T_ASSERT_GE(sarg.ret, 0, "threaded do_select returned an \ in test_select_stress()
339 error: %d!", sarg.ret); in test_select_stress()