1 /* 2 * Copyright (c) 1991 Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 */ 7 8 #ifndef lint 9 char copyright[] = 10 "@(#) Copyright (c) 1991 Regents of the University of California.\n\ 11 All rights reserved.\n"; 12 #endif /* not lint */ 13 14 #ifndef lint 15 static char sccsid[] = "@(#)pwd.c 5.4 (Berkeley) 02/20/91"; 16 #endif /* not lint */ 17 18 #include <unistd.h> 19 #include <errno.h> 20 #include <stdio.h> 21 #include <string.h> 22 23 main() 24 { 25 char *p; 26 27 p = getcwd((char *)NULL, 0); 28 if (p) { 29 (void)printf("%s\n", p); 30 exit(0); 31 } 32 (void)fprintf(stderr, "pwd: %s\n", strerror(errno)); 33 exit(1); 34 } 35