Lines Matching refs:res

41 	int res;  in hello()  local
45 res = write(fd, name, strlen(name)); in hello()
46 if (res < 0) { in hello()
48 } else if (res != strlen(name)) { in hello()
49 printf("only wrote %d/%d bytes", res, (int)strlen(name)); in hello()
53 res = read(fd, buf, sizeof(buf) - 1); in hello()
54 if (res < 0) { in hello()
56 } else if (res != strlen(name)) { in hello()
57 printf("only read %d/%d bytes", res, (int)strlen(name)); in hello()
86 int res = -1; in fd_to_idx() local
91 res = i; in fd_to_idx()
96 return res; in fd_to_idx()
101 int res; in setup() local
111 res = socketpair(AF_UNIX, SOCK_STREAM, 0, ctx[i].spair); in setup()
112 if (res < 0) { in setup()
114 return res; in setup()
119 res = pthread_attr_init(attrp); in setup()
120 if (res != 0) { in setup()
121 errno = res; in setup()
123 return -res; in setup()
126 res = pthread_attr_setstack(&attr, &stack[i], STACK_SIZE); in setup()
127 if (res != 0) { in setup()
128 errno = res; in setup()
130 return -res; in setup()
134 res = pthread_create(&ctx[i].thread, attrp, fun, &ctx[i]); in setup()
135 if (res != 0) { in setup()
136 errno = res; in setup()
138 return -res; in setup()
175 int res; in handle_poll_events() local
194 res = read(fds[i].fd, buf, sizeof(buf)); in handle_poll_events()
195 if (res < 0) { in handle_poll_events()
206 res = write(fds[i].fd, buf, res); in handle_poll_events()
207 if (res < 0) { in handle_poll_events()
226 int res; in main() local
231 res = setup(ctx, NUM_SOCKETPAIRS); in main()
232 if (res < 0) { in main()
236 for (size_t n_events = NUM_SOCKETPAIRS * NUM_REPITITIONS; n_events > 0; n_events -= res) { in main()
239 res = poll(fds, NUM_SOCKETPAIRS, -1); in main()
240 if (res < 0) { in main()
245 res = handle_poll_events(ctx, fds, NUM_SOCKETPAIRS, res); in main()
246 if (res < 0) { in main()
251 res = 0; in main()
257 printf("%s\n", res == 0 ? "SUCCESS" : "FAILURE"); in main()
259 return res; in main()