Oh, it seems, that sys.c:1395 makes pipe for spawned process input-output, so what I need, is to get fd for output of first open_port and pass it as input for second open_port call.