* ext/socket/rubysocket.h (rsock_recvmsg): declared.
* ext/socket/ancdata.c (rsock_recvmsg): extracted from nogvl_recvmsg_func. (nogvl_recvmsg_func): use rsock_recvmsg. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
600fcacc75
commit
5cb6365487
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
||||
Sun Nov 6 14:49:58 2011 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/socket/rubysocket.h (rsock_recvmsg): declared.
|
||||
|
||||
* ext/socket/ancdata.c (rsock_recvmsg): extracted from
|
||||
nogvl_recvmsg_func.
|
||||
(nogvl_recvmsg_func): use rsock_recvmsg.
|
||||
|
||||
* ext/socket/unixsocket.c (recvmsg_blocking): use rsock_recvmsg.
|
||||
|
||||
Sun Nov 06 03:22:36 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
|
||||
|
||||
* test/openssl/test_engine.rb: add test for engine cipher. RC4 is used
|
||||
|
@ -1358,16 +1358,22 @@ struct recvmsg_args_struct {
|
||||
int flags;
|
||||
};
|
||||
|
||||
ssize_t
|
||||
rsock_recvmsg(int socket, struct msghdr *message, int flags)
|
||||
{
|
||||
#ifdef MSG_CMSG_CLOEXEC
|
||||
/* MSG_CMSG_CLOEXEC is available since Linux 2.6.23. Linux 2.6.18 silently ignore it. */
|
||||
flags |= MSG_CMSG_CLOEXEC;
|
||||
#endif
|
||||
return recvmsg(socket, message, flags);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
nogvl_recvmsg_func(void *ptr)
|
||||
{
|
||||
struct recvmsg_args_struct *args = ptr;
|
||||
int flags = args->flags;
|
||||
#ifdef MSG_CMSG_CLOEXEC
|
||||
/* MSG_CMSG_CLOEXEC is available since Linux 2.6.23. Linux 2.6.18 silently ignore it. */
|
||||
flags |= MSG_CMSG_CLOEXEC;
|
||||
#endif
|
||||
return recvmsg(args->fd, args->msg, flags);
|
||||
return rsock_recvmsg(args->fd, args->msg, flags);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
|
@ -282,6 +282,7 @@ VALUE rsock_bsock_sendmsg_nonblock(int argc, VALUE *argv, VALUE sock);
|
||||
#if defined(HAVE_RECVMSG)
|
||||
VALUE rsock_bsock_recvmsg(int argc, VALUE *argv, VALUE sock);
|
||||
VALUE rsock_bsock_recvmsg_nonblock(int argc, VALUE *argv, VALUE sock);
|
||||
ssize_t rsock_recvmsg(int socket, struct msghdr *message, int flags);
|
||||
#else
|
||||
#define rsock_bsock_recvmsg rb_f_notimplement
|
||||
#define rsock_bsock_recvmsg_nonblock rb_f_notimplement
|
||||
|
@ -265,11 +265,7 @@ recvmsg_blocking(void *data)
|
||||
{
|
||||
struct iomsg_arg *arg = data;
|
||||
int flags = 0;
|
||||
#ifdef MSG_CMSG_CLOEXEC
|
||||
/* MSG_CMSG_CLOEXEC is available since Linux 2.6.23. Linux 2.6.18 silently ignore it. */
|
||||
flags |= MSG_CMSG_CLOEXEC;
|
||||
#endif
|
||||
return recvmsg(arg->fd, &arg->msg, flags);
|
||||
return rsock_recvmsg(arg->fd, &arg->msg, flags);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user