add st_dev.c and fix chdir.c