2
0
mirror of git://github.com/lxc/lxc synced 2025-08-31 15:19:26 +00:00

file_utils: add lxc_send_nointr()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner
2018-09-03 14:43:06 +02:00
parent e3233f26ce
commit 28143f8862
2 changed files with 12 additions and 0 deletions

View File

@@ -106,6 +106,17 @@ again:
return ret;
}
ssize_t lxc_send_nointr(int sockfd, void *buf, size_t len, int flags)
{
ssize_t ret;
again:
ret = send(sockfd, buf, len, flags);
if (ret < 0 && errno == EINTR)
goto again;
return ret;
}
ssize_t lxc_read_nointr(int fd, void *buf, size_t count)
{
ssize_t ret;

View File

@@ -37,6 +37,7 @@ extern int lxc_read_from_file(const char *filename, void *buf, size_t count);
/* send and receive buffers completely */
extern ssize_t lxc_write_nointr(int fd, const void *buf, size_t count);
extern ssize_t lxc_send_nointr(int sockfd, void *buf, size_t len, int flags);
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);