Annotation of 42BSD/usr.lib/libU77/getcwd_.c, revision 1.1.1.1

1.1       root        1: /*
                      2: char id_getcwd[] = "@(#)getcwd_.c      1.5";
                      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: 
                     13: #include <sys/param.h>
                     14: #ifndef        MAXPATHLEN
                     15: #define MAXPATHLEN     128
                     16: #endif
                     17: 
                     18: extern int errno;
                     19: char   *getwd();
                     20: 
                     21: long
                     22: getcwd_(path, len)
                     23: char *path;
                     24: long len;
                     25: {
                     26:        char    *p;
                     27:        char    pathname[MAXPATHLEN];
                     28: 
                     29:        p = getwd(pathname);
                     30:        b_char(pathname, path, len);
                     31:        if (p)
                     32:                return(0L);
                     33:        else
                     34:                return((long)errno);
                     35: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.