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
99d03dec
Commit
99d03dec
authored
Jul 04, 2019
by
Wolfgang Bumiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
file_utils: add lxc_recvmsg_nointr_iov
Signed-off-by:
Wolfgang Bumiller
<
w.bumiller@proxmox.com
>
parent
970ef13d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
file_utils.c
src/lxc/file_utils.c
+18
-0
file_utils.h
src/lxc/file_utils.h
+3
-0
No files found.
src/lxc/file_utils.c
View file @
99d03dec
...
...
@@ -142,6 +142,24 @@ again:
return
ret
;
}
ssize_t
lxc_recvmsg_nointr_iov
(
int
sockfd
,
struct
iovec
*
iov
,
size_t
iovlen
,
int
flags
)
{
ssize_t
ret
;
struct
msghdr
msg
;
memset
(
&
msg
,
0
,
sizeof
(
msg
));
msg
.
msg_iov
=
iov
;
msg
.
msg_iovlen
=
iovlen
;
again:
ret
=
recvmsg
(
sockfd
,
&
msg
,
flags
);
if
(
ret
<
0
&&
errno
==
EINTR
)
goto
again
;
return
ret
;
}
ssize_t
lxc_read_nointr_expect
(
int
fd
,
void
*
buf
,
size_t
count
,
const
void
*
expected_buf
)
{
ssize_t
ret
;
...
...
src/lxc/file_utils.h
View file @
99d03dec
...
...
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/vfs.h>
#include <unistd.h>
...
...
@@ -43,6 +44,8 @@ extern ssize_t lxc_read_nointr_expect(int fd, void *buf, size_t count,
extern
ssize_t
lxc_read_file_expect
(
const
char
*
path
,
void
*
buf
,
size_t
count
,
const
void
*
expected_buf
);
extern
ssize_t
lxc_recv_nointr
(
int
sockfd
,
void
*
buf
,
size_t
len
,
int
flags
);
ssize_t
lxc_recvmsg_nointr_iov
(
int
sockfd
,
struct
iovec
*
iov
,
size_t
iovlen
,
int
flags
);
extern
bool
file_exists
(
const
char
*
f
);
extern
int
print_to_file
(
const
char
*
file
,
const
char
*
content
);
...
...
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