Commit | Line | Data |
---|---|---|
33b14136 MD |
1 | #ifndef LTTNG_COMMON_READWRITE_H |
2 | #define LTTNG_COMMON_READWRITE_H | |
3 | ||
4 | /* | |
ab5be9fa | 5 | * Copyright (C) 2013 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
33b14136 | 6 | * |
ab5be9fa | 7 | * SPDX-License-Identifier: LGPL-2.1-only |
33b14136 | 8 | * |
33b14136 MD |
9 | */ |
10 | ||
c9e313bc | 11 | #include <common/macros.hpp> |
33b14136 | 12 | |
28f23191 JG |
13 | #include <unistd.h> |
14 | ||
33b14136 MD |
15 | /* |
16 | * lttng_read and lttng_write take care of EINTR and partial read/write. | |
17 | * Upon success, they return the "count" received as parameter. | |
18 | * They can return a negative value if an error occurs. | |
19 | * If a value lower than the requested "count" is returned, it means an | |
83f4233d | 20 | * error occurred. |
33b14136 MD |
21 | * The error can be checked by querying errno. |
22 | */ | |
23 | ssize_t lttng_read(int fd, void *buf, size_t count); | |
24 | ssize_t lttng_write(int fd, const void *buf, size_t count); | |
25 | ||
26 | #endif /* LTTNG_COMMON_READWRITE_H */ |