+#endif //0
+ len = pair->subbuf_size;
+ offset = 0;
+ while (len > 0) {
+ printf("splice chan to pipe offset %lu\n", offset);
+ ret = splice(pair->channel, &offset, thread_pipe[1], NULL,
+ len, SPLICE_F_MOVE);
+ printf("splice chan to pipe ret %ld\n", ret);
+ if (ret < 0) {
+ perror("Error in relay splice");
+ goto write_error;
+ }
+ ret = splice(thread_pipe[0], NULL, pair->trace, NULL,
+ ret, SPLICE_F_MOVE);
+ printf("splice pipe to file %ld\n", ret);
+ if (ret < 0) {
+ perror("Error in file splice");
+ goto write_error;
+ }
+ len -= ret;
+ }
+