Lines Matching refs:nbytes
255 * in nbytes or it fails with a condition that cannot be handled with a simple
259 static ssize_t fullread(int filedes, void *buffer, size_t nbytes)
266 rc = read(filedes, (unsigned char *)buffer + nread, nbytes - nread);
288 } while((size_t)nread < nbytes);
299 * indicated in nbytes or it fails with a condition that cannot be handled
303 static ssize_t fullwrite(int filedes, const void *buffer, size_t nbytes)
310 wc = write(filedes, (unsigned char *)buffer + nwrite, nbytes - nwrite);
332 } while((size_t)nwrite < nbytes);
341 * read_stdin tries to read from stdin nbytes into the given buffer. This is a
342 * blocking function that will only return TRUE when nbytes have actually been
347 static bool read_stdin(void *buffer, size_t nbytes)
349 ssize_t nread = fullread(fileno(stdin), buffer, nbytes);
350 if(nread != (ssize_t)nbytes) {
358 * write_stdout tries to write to stdio nbytes from the given buffer. This is a
359 * blocking function that will only return TRUE when nbytes have actually been
364 static bool write_stdout(const void *buffer, size_t nbytes)
366 ssize_t nwrite = fullwrite(fileno(stdout), buffer, nbytes);
367 if(nwrite != (ssize_t)nbytes) {