1 /* 2 * Copyright (c) 1980 Regents of the University of California. 3 * All rights reserved. The Berkeley software License Agreement 4 * specifies the terms and conditions for redistribution. 5 */ 6 7 #ifndef lint 8 char copyright[] = 9 "@(#) Copyright (c) 1980 Regents of the University of California.\n\ 10 All rights reserved.\n"; 11 #endif not lint 12 13 #ifndef lint 14 static char sccsid[] = "@(#)pwd.c 5.1 (Berkeley) 04/30/85"; 15 #endif not lint 16 17 /* 18 * Print working (current) directory 19 */ 20 #include <stdio.h> 21 #include <sys/param.h> 22 23 char *getwd(); 24 25 main() 26 { 27 char pathname[MAXPATHLEN + 1]; 28 29 if (getwd(pathname) == NULL) { 30 fprintf(stderr, "pwd: %s\n", pathname); 31 exit(1); 32 } 33 printf("%s\n", pathname); 34 exit(0); 35 } 36