From 6854f5e0729435bdd84b03756603f5e8a758778e Mon Sep 17 00:00:00 2001 From: Jann Horn Date: Sun, 24 Nov 2013 04:01:13 +0100 Subject: [PATCH] add fastrecat --- tools/fastrecat.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tools/fastrecat.c 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(); + } +} -- 2.20.1