mirror of
git://github.com/lxc/lxc
synced 2025-09-03 16:49:34 +00:00
file_utils: add lxc_send_nointr()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
@@ -106,6 +106,17 @@ again:
|
|||||||
return ret;
|
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 lxc_read_nointr(int fd, void *buf, size_t count)
|
||||||
{
|
{
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
@@ -37,6 +37,7 @@ extern int lxc_read_from_file(const char *filename, void *buf, size_t count);
|
|||||||
|
|
||||||
/* send and receive buffers completely */
|
/* send and receive buffers completely */
|
||||||
extern ssize_t lxc_write_nointr(int fd, const void *buf, size_t count);
|
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(int fd, void *buf, size_t count);
|
||||||
extern ssize_t lxc_read_nointr_expect(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);
|
const void *expected_buf);
|
||||||
|
Reference in New Issue
Block a user