X-Git-Url: http://git.thejh.net/?p=tools.git;a=blobdiff_plain;f=tools%2Ffastrecat.c;fp=tools%2Ffastrecat.c;h=ff57776f35d10dfd98442e3b16c9b5a7180b9462;hp=0000000000000000000000000000000000000000;hb=6854f5e0729435bdd84b03756603f5e8a758778e;hpb=16703744c4df52f40e977b3b602f9f05579c2193 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(); + } +}