Move code to os_access.