xref: /csrg-svn/lib/libc/compat-43/getwd.c (revision 60986)
146481Sbostic /*-
2*60986Sbostic  * Copyright (c) 1990, 1993
3*60986Sbostic  *	The Regents of the University of California.  All rights reserved.
446481Sbostic  *
546481Sbostic  * %sccs.include.redist.c%
646481Sbostic  */
746481Sbostic 
846481Sbostic #if defined(LIBC_SCCS) && !defined(lint)
9*60986Sbostic static char sccsid[] = "@(#)getwd.c	8.1 (Berkeley) 06/02/93";
1046481Sbostic #endif /* LIBC_SCCS and not lint */
1146481Sbostic 
1246481Sbostic #include <sys/param.h>
1346481Sbostic #include <unistd.h>
1446481Sbostic #include <errno.h>
1546481Sbostic #include <stdio.h>
1646481Sbostic #include <string.h>
1746481Sbostic 
1846481Sbostic char *
getwd(buf)1946481Sbostic getwd(buf)
2046481Sbostic 	char *buf;
2146481Sbostic {
2246481Sbostic 	char *p;
2346481Sbostic 
2446481Sbostic 	if (p = getcwd(buf, MAXPATHLEN))
2546481Sbostic 		return(p);
2646481Sbostic 	(void)strcpy(buf, strerror(errno));
2746481Sbostic 	return((char *)NULL);
2846481Sbostic }
29