Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
dc85e31e
Commit
dc85e31e
authored
Jul 09, 2019
by
Christian Brauner
Committed by
Wolfgang Bumiller
Jul 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
af_unix: add lxc_abstract_unix_recv_fds_iov()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
e1726045
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
af_unix.c
src/lxc/af_unix.c
+15
-8
No files found.
src/lxc/af_unix.c
View file @
dc85e31e
...
...
@@ -212,20 +212,18 @@ int lxc_unix_send_fds(int fd, int *sendfds, int num_sendfds, void *data,
return
lxc_abstract_unix_send_fds
(
fd
,
sendfds
,
num_sendfds
,
data
,
size
);
}
int
lxc_abstract_unix_recv_fds
(
int
fd
,
int
*
recvfds
,
int
num_recvfds
,
void
*
data
,
size_t
size
)
static
int
lxc_abstract_unix_recv_fds_iov
(
int
fd
,
int
*
recvfds
,
int
num_recvfds
,
struct
iovec
*
iov
,
size_t
iovlen
)
{
__do_free
char
*
cmsgbuf
=
NULL
;
int
ret
;
struct
msghdr
msg
;
struct
iovec
iov
;
struct
cmsghdr
*
cmsg
=
NULL
;
char
buf
[
1
]
=
{
0
};
size_t
cmsgbufsize
=
CMSG_SPACE
(
sizeof
(
struct
ucred
))
+
CMSG_SPACE
(
num_recvfds
*
sizeof
(
int
));
memset
(
&
msg
,
0
,
sizeof
(
msg
));
memset
(
&
iov
,
0
,
sizeof
(
iov
));
cmsgbuf
=
malloc
(
cmsgbufsize
);
if
(
!
cmsgbuf
)
{
...
...
@@ -236,10 +234,8 @@ int lxc_abstract_unix_recv_fds(int fd, int *recvfds, int num_recvfds,
msg
.
msg_control
=
cmsgbuf
;
msg
.
msg_controllen
=
cmsgbufsize
;
iov
.
iov_base
=
data
?
data
:
buf
;
iov
.
iov_len
=
data
?
size
:
sizeof
(
buf
);
msg
.
msg_iov
=
&
iov
;
msg
.
msg_iovlen
=
1
;
msg
.
msg_iov
=
iov
;
msg
.
msg_iovlen
=
iovlen
;
again:
ret
=
recvmsg
(
fd
,
&
msg
,
0
);
...
...
@@ -271,6 +267,17 @@ out:
return
ret
;
}
int
lxc_abstract_unix_recv_fds
(
int
fd
,
int
*
recvfds
,
int
num_recvfds
,
void
*
data
,
size_t
size
)
{
char
buf
[
1
]
=
{
0
};
struct
iovec
iov
=
{
.
iov_base
=
data
?
data
:
buf
,
.
iov_len
=
data
?
size
:
sizeof
(
buf
),
};
return
lxc_abstract_unix_recv_fds_iov
(
fd
,
recvfds
,
num_recvfds
,
&
iov
,
1
);
}
int
lxc_abstract_unix_send_credential
(
int
fd
,
void
*
data
,
size_t
size
)
{
struct
msghdr
msg
=
{
0
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment