43d4e39eeeaed22896337995b440ba2e5fe46952
2 * Copyright (C) 2013 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License, version 2.1 only,
6 * as published by the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #include "readwrite.h"
22 * lttng_read and lttng_write take care of EINTR and partial read/write.
23 * Upon success, they return the "count" received as parameter.
24 * They can return a negative value if an error occurs.
25 * If a value lower than the requested "count" is returned, it means an
27 * The error can be checked by querying errno.
29 ssize_t
lttng_read(int fd
, void *buf
, size_t count
)
35 ret
= read(fd
, &buf
[i
], count
- i
);
38 continue; /* retry operation */
45 } while (count
- i
> 0 && ret
> 0);
56 ssize_t
lttng_write(int fd
, const void *buf
, size_t count
)
62 ret
= write(fd
, &buf
[i
], count
- i
);
65 continue; /* retry operation */
72 } while (count
- i
> 0 && ret
> 0);
This page took 0.032293 seconds and 5 git commands to generate.