marvelous dup2 trick