1: /* 2: char id_chdir[] = "@(#)chdir_.c 1.3"; 3: * 4: * change default directory 5: * 6: * calling sequence: 7: * integer chdir 8: * ierror = chdir(dirname) 9: * where: 10: * ierror will receive a returned status (0 == OK) 11: * dirname is the directory name 12: */ 13: 14: #include "../libI77/fiodefs.h" 15: #include <sys/param.h> 16: #ifndef MAXPATHLEN 17: #define MAXPATHLEN 128 18: #endif 19: 20: ftnint chdir_(dname, dnamlen) 21: char *dname; 22: ftnlen dnamlen; 23: { 24: char buf[MAXPATHLEN]; 25: 26: if (dnamlen >= sizeof buf) 27: return((ftnint)(errno=F_ERARG)); 28: g_char(dname, dnamlen, buf); 29: if (chdir(buf) != 0) 30: return((ftnint)errno); 31: return((ftnint) 0); 32: }