Please check the manual page chdir(2).