Browse Source

Test

etomic
jl777 7 years ago
parent
commit
1fd97e7c5b
  1. 6
      crypto777/nanosrc/core/global.c

6
crypto777/nanosrc/core/global.c

@ -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 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; 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; NN_BASIC_CHECKS;
if ( nn_slow(!msghdr) ) if ( nn_slow(!msghdr) )
{ {
printf("nn_sendmsg.EINVAL\n");
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
if ( nn_slow(msghdr->msg_iovlen < 0) ) if ( nn_slow(msghdr->msg_iovlen < 0) )
{ {
printf("nn_sendmsg.EMSGSIZE\n");
errno = EMSGSIZE; errno = EMSGSIZE;
return -1; 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) ) if ( nn_slow(chunk == NULL) )
{ {
errno = EFAULT; errno = EFAULT;
printf("nn_sendmsg.EFAULT\n");
return -1; return -1;
} }
sz = nn_chunk_size(chunk); 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. */ /* Send it further down the stack. */
rc = nn_sock_send (SELF.socks [s], &msg, flags); rc = nn_sock_send (SELF.socks [s], &msg, flags);
printf("nn_sock_send rc.%d\n",rc);
if (nn_slow (rc < 0)) { if (nn_slow (rc < 0)) {
/* If we are dealing with user-supplied buffer, detach it from /* If we are dealing with user-supplied buffer, detach it from

Loading…
Cancel
Save