This will be used to pass MSG_DONTWAIT in next patch.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Replace "-1" return with errno codes.
ENOMSG and EBADFD were choosen to do not cross with
standard recvmsg() errors (described in its man page).
This patch is need as preparation to making recv_msg()
be able to be non-block, and return EAGAIN and EWOULDBLOCK
in case of no data.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Remove getting opts from descriptors out from scm engine,
this stuff is pure criu thing, so make it collect the data.
The tricky change here is that parasite code needs memory
to keep fd_opts on. The memory is taken from parasite args
region, which is now bigger than it used to be. But that's
not a big deal, as previously this space was allocated on
the parasite stack (!, but with smaller chunks).
On the other hand, now we have one memcpy less, as opts are
put directly into the destination buffer.
travis-ci: success for files: Rework send/recv-fds to be more generic
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
When SCM_FDSET_HAS_OPTS is not set the scm-code.c
can't be built because it declares struct fd_opts
in parameters. Lets rather hide this type and
allow to build without SCM_FDSET_HAS_OPTS definition.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
In pure-compel library messing with opts is not required,
only criu and criu's pie will need it, so make it possible
to compile out common/scm-code's opts management.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>