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