Lines Matching defs:ctx
2702 struct sock_accept *ctx = data;
2703 struct sockaddr *addr = SAS2SA(ctx->addrbuf);
2704 socklen_t *paddrlen = ctx->addrlen;
2711 *ctx->addrlen = 0;
2717 ctx->result = accept4(s->sock_fd, addr, paddrlen,
2719 if (ctx->result == INVALID_SOCKET && accept4_works == -1) {
2725 ctx->result = accept(s->sock_fd, addr, paddrlen);
2727 ctx->result = accept(s->sock_fd, addr, paddrlen);
2731 return (ctx->result != INVALID_SOCKET);
2733 return (ctx->result >= 0);
2748 struct sock_accept ctx;
2757 ctx.addrlen = &addrlen;
2758 ctx.addrbuf = &addrbuf;
2759 if (sock_call(s, 0, sock_accept_impl, &ctx) < 0)
2761 newfd = ctx.result;
3495 struct sock_recv *ctx = data;
3498 if (ctx->len > INT_MAX)
3499 ctx->len = INT_MAX;
3500 ctx->result = recv(s->sock_fd, ctx->cbuf, (int)ctx->len, ctx->flags);
3502 ctx->result = recv(s->sock_fd, ctx->cbuf, ctx->len, ctx->flags);
3504 return (ctx->result >= 0);
3520 struct sock_recv ctx;
3531 ctx.cbuf = cbuf;
3532 ctx.len = len;
3533 ctx.flags = flags;
3534 if (sock_call(s, 0, sock_recv_impl, &ctx) < 0)
3537 return ctx.result;
3664 struct sock_recvfrom *ctx = data;
3666 memset(ctx->addrbuf, 0, *ctx->addrlen);
3669 if (ctx->len > INT_MAX)
3670 ctx->len = INT_MAX;
3671 ctx->result = recvfrom(s->sock_fd, ctx->cbuf, (int)ctx->len, ctx->flags,
3672 SAS2SA(ctx->addrbuf), ctx->addrlen);
3674 ctx->result = recvfrom(s->sock_fd, ctx->cbuf, ctx->len, ctx->flags,
3675 SAS2SA(ctx->addrbuf), ctx->addrlen);
3677 return (ctx->result >= 0);
3698 struct sock_recvfrom ctx;
3710 ctx.cbuf = cbuf;
3711 ctx.len = len;
3712 ctx.flags = flags;
3713 ctx.addrbuf = &addrbuf;
3714 ctx.addrlen = &addrlen;
3715 if (sock_call(s, 0, sock_recvfrom_impl, &ctx) < 0)
3723 return ctx.result;
3847 struct sock_recvmsg *ctx = data;
3849 ctx->result = recvmsg(s->sock_fd, ctx->msg, ctx->flags);
3850 return (ctx->result >= 0);
3876 struct sock_recvmsg ctx;
3910 ctx.msg = &msg;
3911 ctx.flags = flags;
3912 if (sock_call(s, 0, sock_recvmsg_impl, &ctx) < 0)
3955 (*makeval)(ctx.result, makeval_data),
4173 struct sock_send *ctx = data;
4176 if (ctx->len > INT_MAX)
4177 ctx->len = INT_MAX;
4178 ctx->result = send(s->sock_fd, ctx->buf, (int)ctx->len, ctx->flags);
4180 ctx->result = send(s->sock_fd, ctx->buf, ctx->len, ctx->flags);
4182 return (ctx->result >= 0);
4192 struct sock_send ctx;
4201 ctx.buf = pbuf.buf;
4202 ctx.len = pbuf.len;
4203 ctx.flags = flags;
4204 if (sock_call(s, 1, sock_send_impl, &ctx) < 0) {
4210 return PyLong_FromSsize_t(ctx.result);
4230 struct sock_send ctx;
4264 ctx.buf = buf;
4265 ctx.len = len;
4266 ctx.flags = flags;
4267 if (sock_call_ex(s, 1, sock_send_impl, &ctx, 0, NULL, timeout) < 0)
4269 n = ctx.result;
4313 struct sock_sendto *ctx = data;
4316 if (ctx->len > INT_MAX)
4317 ctx->len = INT_MAX;
4318 ctx->result = sendto(s->sock_fd, ctx->buf, (int)ctx->len, ctx->flags,
4319 SAS2SA(ctx->addrbuf), ctx->addrlen);
4321 ctx->result = sendto(s->sock_fd, ctx->buf, ctx->len, ctx->flags,
4322 SAS2SA(ctx->addrbuf), ctx->addrlen);
4324 return (ctx->result >= 0);
4337 struct sock_sendto ctx;
4374 ctx.buf = pbuf.buf;
4375 ctx.len = pbuf.len;
4376 ctx.flags = flags;
4377 ctx.addrlen = addrlen;
4378 ctx.addrbuf = &addrbuf;
4379 if (sock_call(s, 1, sock_sendto_impl, &ctx) < 0) {
4385 return PyLong_FromSsize_t(ctx.result);
4465 struct sock_sendmsg *ctx = data;
4467 ctx->result = sendmsg(s->sock_fd, ctx->msg, ctx->flags);
4468 return (ctx->result >= 0);
4490 struct sock_sendmsg ctx;
4637 ctx.msg = &msg;
4638 ctx.flags = flags;
4639 if (sock_call(s, 1, sock_sendmsg_impl, &ctx) < 0)
4642 retval = PyLong_FromSsize_t(ctx.result);
4700 struct sock_sendmsg ctx;
4814 ctx.msg = &msg;
4815 ctx.flags = flags;
4816 if (sock_call(self, 1, sock_sendmsg_impl, &ctx) < 0) {
4820 retval = PyLong_FromSsize_t(ctx.result);