6 * read_write_all - read_all and write_all routines.
8 * Successful read and write calls may only partly complete if a
9 * signal is received or they are not operating on a normal file.
11 * read_all() and write_all() do the looping for you.
17 * #include <ccan/read_write_all/read_write_all.h>
19 * #define BUFFER_SIZE 10
22 * char buffer[BUFFER_SIZE+1];
24 * if (!read_all(STDIN_FILENO, buffer, BUFFER_SIZE))
25 * err(1, "Could not read %u characters", BUFFER_SIZE);
26 * buffer[BUFFER_SIZE] = '\0';
27 * printf("I read '%.*s'\n", BUFFER_SIZE, buffer);
31 * License: LGPL (v2.1 or any later version)
32 * Author: Rusty Russell <rusty@rustcorp.com.au>
34 int main(int argc, char *argv[])
39 if (strcmp(argv[1], "depends") == 0) {