2
0
mirror of git://github.com/lxc/lxc synced 2025-08-31 02:39:36 +00:00

file_utils: add lxc_recv_nointr()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner
2018-09-03 02:51:39 +02:00
parent a8007512f7
commit de69edd15e
2 changed files with 13 additions and 0 deletions

View File

@@ -117,6 +117,17 @@ again:
return ret;
}
ssize_t lxc_recv_nointr(int sockfd, void *buf, size_t len, int flags)
{
ssize_t ret;
again:
ret = recv(sockfd, buf, len, 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;

View File

@@ -40,6 +40,8 @@ extern ssize_t lxc_write_nointr(int fd, const void *buf, size_t count);
extern ssize_t lxc_read_nointr(int fd, void *buf, size_t count);
extern ssize_t lxc_read_nointr_expect(int fd, void *buf, size_t count,
const void *expected_buf);
extern ssize_t lxc_recv_nointr(int sockfd, void *buf, size_t len, int flags);
extern bool file_exists(const char *f);
extern int print_to_file(const char *file, const char *content);
extern int is_dir(const char *path);