date and time created 83/05/20 10:43:19 by nicklin
[unix-history] / usr / src / usr.bin / f77 / libU77 / getcwd_.c
CommitLineData
dd052957 1/*
05ec41e3 2char id_getcwd[] = "@(#)getcwd_.c 1.5";
dd052957
DW
3 * Get pathname of current working directory.
4 *
5 * calling sequence:
6 * character*128 path
7 * ierr = getcwd(path)
8 * where:
9 * path will receive the pathname of the current working directory.
10 * ierr will be 0 if successful, a system error code otherwise.
11 */
12
05ec41e3
DW
13#include <sys/param.h>
14#ifndef MAXPATHLEN
15#define MAXPATHLEN 128
16#endif
17
dd052957 18extern int errno;
28a346e8 19char *getwd();
dd052957
DW
20
21long
22getcwd_(path, len)
23char *path;
431aa77e 24long len;
dd052957 25{
28a346e8 26 char *p;
05ec41e3 27 char pathname[MAXPATHLEN];
dd052957 28
28a346e8
DW
29 p = getwd(pathname);
30 b_char(pathname, path, len);
dd052957 31 if (p)
dd052957 32 return(0L);
28a346e8
DW
33 else
34 return((long)errno);
dd052957 35}