// close(pipes[0]);
// close(pipes[1]);
// rb_jump_tag(state);
// }
r = new RubyIO(runtime, (RubyClass)klass);
r.initializeCommon(context, new ChannelFD(fds[0], runtime.getPosix(), runtime.getFilenoUtil()), runtime.newFixnum(OpenFlags.O_RDONLY), context.nil);
fptr = r.getOpenFileChecked();
r.setEncoding(context, v1, v2, opt);
// args[1] = INT2NUM(pipes[1]);
// args[2] = INT2FIX(O_WRONLY);
// w = rb_protect(io_new_instance, (VALUE)args, &state);
// if (state) {
// close(pipes[1]);
// if (!NIL_P(r)) rb_io_close(r);
// rb_jump_tag(state);
// }
w = new RubyIO(runtime, (RubyClass)klass);
w.initializeCommon(context, new ChannelFD(fds[1], runtime.getPosix(), runtime.getFilenoUtil()), runtime.newFixnum(OpenFlags.O_WRONLY), context.nil);
fptr2 = w.getOpenFileChecked();
fptr2.setSync(true);
EncodingUtils.extractBinmode(runtime, opt, fmode_p);