Lines Matching defs:buflen
35 * Write `buflen' bytes from `buffer' to the file represented by `fd'.
36 * Returns -1 if all `buflen' bytes cannot be written, otherwise returns 0.
39 wbio_nwrite(int fd, const void *buffer, size_t buflen)
45 for (nwritten = 0; nwritten < buflen; nwritten += nbytes) {
46 nbytes = write(fd, &buf[nwritten], buflen - nwritten);
55 * Read `buflen' bytes into `buffer' from the file represented by `fd'.
56 * Returns -1 if all `buflen' bytes cannot be read, otherwise returns 0.
59 wbio_nread(int fd, void *buffer, size_t buflen)
65 for (nread = 0; nread < buflen; nread += nbytes) {
66 nbytes = read(fd, &buf[nread], buflen - nread);
75 * Read a random number of `buflen' bytes into `buffer' from /dev/urandom.
76 * Returns -1 if all `buflen' bytes cannot be read, otherwise returns 0.
79 wbio_nread_rand(void *buffer, size_t buflen)
87 if (wbio_nread(fd, buffer, buflen) != 0) {