1: /* Fortran get home directory PLWard 3/20/80 */ 2: #include <pwd.h> 3: struct passwd *getpwuid(); 4: 5: char homedr_(name,length) 6: char name[]; 7: long length; 8: { 9: register struct passwd *pp; 10: int i,j; 11: 12: pp = getpwuid(getuid()); 13: for (i=0;i < length;i++) name[i]=' '; 14: for (i=0;pp->pw_dir[i] != '\0';i++); 15: if (i > length) return; 16: for (j=0; j < i; j++) 17: name[j]=pp->pw_dir[j]; 18: }