|
|
@ -809,15 +809,17 @@ int32_t nn_recvmsg(int32_t s,struct nn_msghdr *msghdr,int32_t flags) |
|
|
|
int32_t nn_sendmsg(int32_t s,const struct nn_msghdr *msghdr,int32_t flags) |
|
|
|
{ |
|
|
|
int32_t rc,i,nnmsg; size_t sz,spsz; struct nn_iovec *iov; struct nn_msg msg; void *chunk; struct nn_cmsghdr *cmsg; |
|
|
|
//PNACL_msg("nn_sendmsg.(%d) \n",s);
|
|
|
|
printf("nn_sendmsg.(%d) \n",s); |
|
|
|
NN_BASIC_CHECKS; |
|
|
|
if ( nn_slow(!msghdr) ) |
|
|
|
{ |
|
|
|
printf("nn_sendmsg.EINVAL\n"); |
|
|
|
errno = EINVAL; |
|
|
|
return -1; |
|
|
|
} |
|
|
|
if ( nn_slow(msghdr->msg_iovlen < 0) ) |
|
|
|
{ |
|
|
|
printf("nn_sendmsg.EMSGSIZE\n"); |
|
|
|
errno = EMSGSIZE; |
|
|
|
return -1; |
|
|
|
} |
|
|
@ -827,6 +829,7 @@ int32_t nn_sendmsg(int32_t s,const struct nn_msghdr *msghdr,int32_t flags) |
|
|
|
if ( nn_slow(chunk == NULL) ) |
|
|
|
{ |
|
|
|
errno = EFAULT; |
|
|
|
printf("nn_sendmsg.EFAULT\n"); |
|
|
|
return -1; |
|
|
|
} |
|
|
|
sz = nn_chunk_size(chunk); |
|
|
@ -905,6 +908,7 @@ int32_t nn_sendmsg(int32_t s,const struct nn_msghdr *msghdr,int32_t flags) |
|
|
|
|
|
|
|
/* Send it further down the stack. */ |
|
|
|
rc = nn_sock_send (SELF.socks [s], &msg, flags); |
|
|
|
printf("nn_sock_send rc.%d\n",rc); |
|
|
|
if (nn_slow (rc < 0)) { |
|
|
|
|
|
|
|
/* If we are dealing with user-supplied buffer, detach it from
|
|
|
|