io — Helpers for file I/O
#include <igt_io.h>
This library provides helpers for file I/O
ssize_t igt_readn (int fd, char *buf, size_t len);
int fd
char *buf
size_t len
Read from fd into provided buffer until the buffer is full or EOF
fd
the file descriptor
buf
buffer where the contents will be stored, allocated by the caller
size
size of the buffer
-errno on failure or bytes read on success
ssize_t igt_writen (int fd, const char *buf, size_t len);
const char *buf
This writes len bytes from data to the sysfs file.
len
data
the block with the contents to write
the length to write
-errno on failure or bytes written on success