added do_close, do_dup and do_dup2