Skip to content
Commit 4d06aa12 authored by Andrei Vagin's avatar Andrei Vagin
Browse files

fdstore: add a storage for file descriptors (v2)



We need a storage for file descriptors which is shared between processes
and doesn't use a lot of file descriptors. We are going to use it on
restore and if it will use file descriptors, we will have to find
descriptors which don't used by all restored processes to not confilict
with their descriptors.

There are two solutions. The first one is a service (process) which
handles to command push_fd(id, fd) and pop_fd(id, fd).

Another solution is to save descriptros in a unix socket.  It requires
only one extra descriptor which we can register as a service fd. Each
unix socket has a buffer and can fit a number of file descriptros. We
can use SK_PEEK_OFF and MSG_PEEK to get file descriptros from a socket
as many times as we need.

This patch implements the second solution.

v2: call recvmsg with MSG_PEEK
travis-ci: success for A few fixes to c/r a docker container with a console (rev3)
Signed-off-by: default avatarAndrei Vagin <avagin@virtuozzo.com>
Signed-off-by: default avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 6afe523d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment