From: Jann Horn Date: Sun, 24 Nov 2013 03:01:13 +0000 (+0100) Subject: add fastrecat X-Git-Url: http://git.thejh.net/?a=commitdiff_plain;h=6854f5e0729435bdd84b03756603f5e8a758778e;p=tools.git add fastrecat --- diff --git a/tools/fastrecat.c b/tools/fastrecat.c new file mode 100644 index 0000000..ff57776 --- /dev/null +++ b/tools/fastrecat.c @@ -0,0 +1,19 @@ +#include +#include +#include +#include +#include + +int main(int argc, char **argv) { + while (1) { + char buf[4096]; + int fd = open(argv[1], O_RDONLY); + if (fd < 0) continue; + ssize_t s = read(fd, buf, 4096); + if (s>0) { + write(1, buf, s); + } + close(fd); + sched_yield(); + } +}