13557Sdlw /* 2*12143Sdlw char id_getcwd[] = "@(#)getcwd_.c 1.5"; 33557Sdlw * Get pathname of current working directory. 43557Sdlw * 53557Sdlw * calling sequence: 63557Sdlw * character*128 path 73557Sdlw * ierr = getcwd(path) 83557Sdlw * where: 93557Sdlw * path will receive the pathname of the current working directory. 103557Sdlw * ierr will be 0 if successful, a system error code otherwise. 113557Sdlw */ 123557Sdlw 13*12143Sdlw #include <sys/param.h> 14*12143Sdlw #ifndef MAXPATHLEN 15*12143Sdlw #define MAXPATHLEN 128 16*12143Sdlw #endif 17*12143Sdlw 183557Sdlw extern int errno; 1910645Sdlw char *getwd(); 203557Sdlw 213557Sdlw long 223557Sdlw getcwd_(path, len) 233557Sdlw char *path; 243579Sdlw long len; 253557Sdlw { 2610645Sdlw char *p; 27*12143Sdlw char pathname[MAXPATHLEN]; 283557Sdlw 2910645Sdlw p = getwd(pathname); 3010645Sdlw b_char(pathname, path, len); 313557Sdlw if (p) 323557Sdlw return(0L); 3310645Sdlw else 3410645Sdlw return((long)errno); 353557Sdlw } 36