split sys_wait() into a single file.