diff options
author | 2022-11-14 04:08:36 -0800 | |
---|---|---|
committer | 2022-11-14 04:08:36 -0800 | |
commit | 20eff9f6d21742540a7bf68c3dc364bf68b23504 (patch) | |
tree | 0b4b61987ab18b18d221d0c944960b72bb7a1fdf /test/bun.js/test-programs/bigpipe-r.c | |
parent | 69eedb4c9232c7c3e75bc9f17a6ca81c06adcfe0 (diff) | |
download | bun-20eff9f6d21742540a7bf68c3dc364bf68b23504.tar.gz bun-20eff9f6d21742540a7bf68c3dc364bf68b23504.tar.zst bun-20eff9f6d21742540a7bf68c3dc364bf68b23504.zip |
Bugfixes and perf improvements to child_process
Diffstat (limited to 'test/bun.js/test-programs/bigpipe-r.c')
-rw-r--r-- | test/bun.js/test-programs/bigpipe-r.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/bun.js/test-programs/bigpipe-r.c b/test/bun.js/test-programs/bigpipe-r.c new file mode 100644 index 000000000..1acd94f7b --- /dev/null +++ b/test/bun.js/test-programs/bigpipe-r.c @@ -0,0 +1,26 @@ +#include <unistd.h> + +char one_mb_pipe_buf_1[1024 * 1024]; + + int main(int argc, char* argv[]) + { + for (int i = 0; i < sizeof(one_mb_pipe_buf_1); i++) { + one_mb_pipe_buf_1[i] = i % 256; + } + + while (1) { + + + size_t amt = 0; + size_t cnt = 0; + + cnt = 0; + while (cnt < sizeof(one_mb_pipe_buf_1)) { + amt = read(0, one_mb_pipe_buf_1 + cnt, sizeof(one_mb_pipe_buf_1) - cnt); + if (amt == 0) { + break; + } + cnt += amt; + } + } + }
\ No newline at end of file |