net: allow using flags on sending

This commit is contained in:
Thomas Schoebel-Theuer 2015-06-15 12:57:43 +02:00
parent 6e541c8dc9
commit deb574023c

View File

@ -545,7 +545,8 @@ EXPORT_SYMBOL_GPL(mars_send_raw);
* Note: buf may be NULL. In this case, the data is simply consumed, * Note: buf may be NULL. In this case, the data is simply consumed,
* like /dev/null * like /dev/null
*/ */
int mars_recv_raw(struct mars_socket *msock, void *buf, int minlen, int maxlen) static
int _mars_recv_raw(struct mars_socket *msock, void *buf, int minlen, int maxlen, int flags)
{ {
void *dummy = NULL; void *dummy = NULL;
int sleeptime = 1000 / HZ; int sleeptime = 1000 / HZ;
@ -584,7 +585,7 @@ int mars_recv_raw(struct mars_socket *msock, void *buf, int minlen, int maxlen)
struct msghdr msg = { struct msghdr msg = {
.msg_iovlen = 1, .msg_iovlen = 1,
.msg_iov = (struct iovec*)&iov, .msg_iov = (struct iovec*)&iov,
.msg_flags = MSG_NOSIGNAL, .msg_flags = flags | MSG_NOSIGNAL,
}; };
struct socket *sock = msock->s_socket; struct socket *sock = msock->s_socket;
@ -653,6 +654,11 @@ final:
brick_block_free(dummy, maxlen); brick_block_free(dummy, maxlen);
return status; return status;
} }
int mars_recv_raw(struct mars_socket *msock, void *buf, int minlen, int maxlen)
{
return _mars_recv_raw(msock, buf, minlen, maxlen, 0);
}
EXPORT_SYMBOL_GPL(mars_recv_raw); EXPORT_SYMBOL_GPL(mars_recv_raw);
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////