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

1.1       root        1: /*
                      2: char id_chdir[] = "@(#)chdir_.c        1.3";
                      3:  *
                      4:  * change default directory
                      5:  *
                      6:  * calling sequence:
                      7:  *     integer chdir
                      8:  *     ierror = chdir(dirname)
                      9:  * where:
                     10:  *     ierror will receive a returned status (0 == OK)
                     11:  *     dirname is the directory name
                     12:  */
                     13: 
                     14: #include "../libI77/f_errno.h"
                     15: #include <sys/param.h>
                     16: #ifndef        MAXPATHLEN
                     17: #define MAXPATHLEN     128
                     18: #endif
                     19: 
                     20: long chdir_(dname, dnamlen)
                     21: char *dname;
                     22: long dnamlen;
                     23: {
                     24:        char buf[MAXPATHLEN];
                     25: 
                     26:        if (dnamlen >= sizeof buf)
                     27:                return((long)(errno=F_ERARG));
                     28:        g_char(dname, dnamlen, buf);
                     29:        if (chdir(buf) != 0)
                     30:                return((long)errno);
                     31:        return(0L);
                     32: }

unix.superglobalmegacorp.com

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