implement do_close and do_exec. it's almost done.