X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=src%2Fcommon%2Freadwrite.hpp;fp=src%2Fcommon%2Freadwrite.hpp;h=1818fdb261f6f7c53f1f1bb788014ec8201c1f25;hb=7532fa3bd22e403958f46cd35c824f490d93292d;hp=0000000000000000000000000000000000000000;hpb=985aea182b618c85c51651f224abedfe367c75ee;p=deliverable%2Flttng-tools.git diff --git a/src/common/readwrite.hpp b/src/common/readwrite.hpp new file mode 100644 index 000000000..1818fdb26 --- /dev/null +++ b/src/common/readwrite.hpp @@ -0,0 +1,25 @@ +#ifndef LTTNG_COMMON_READWRITE_H +#define LTTNG_COMMON_READWRITE_H + +/* + * Copyright (C) 2013 Mathieu Desnoyers + * + * SPDX-License-Identifier: LGPL-2.1-only + * + */ + +#include +#include + +/* + * lttng_read and lttng_write take care of EINTR and partial read/write. + * Upon success, they return the "count" received as parameter. + * They can return a negative value if an error occurs. + * If a value lower than the requested "count" is returned, it means an + * error occurred. + * The error can be checked by querying errno. + */ +ssize_t lttng_read(int fd, void *buf, size_t count); +ssize_t lttng_write(int fd, const void *buf, size_t count); + +#endif /* LTTNG_COMMON_READWRITE_H */