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

1.1       root        1: /*
                      2: char id_stat[] = "@(#)lstat_.c 1.2";
                      3:  *
                      4:  * get file status
                      5:  *
                      6:  * calling sequence:
                      7:  *     integer lstat, statb(12)
                      8:  *     external lstat
                      9:  *     ierr = lstat (name, statb)
                     10:  * where:
                     11:  *     'statb' will receive the stat structure for file 'name'.
                     12:  */
                     13: 
                     14: #include <sys/param.h>
                     15: #ifndef        MAXPATHLEN
                     16: #define MAXPATHLEN     128
                     17: #endif
                     18: #include <sys/stat.h>
                     19: #include "../libI77/f_errno.h"
                     20: 
                     21: long lstat_(name, stbuf, namlen)
                     22: char *name; long *stbuf, namlen;
                     23: {
                     24:        char buf[MAXPATHLEN];
                     25:        struct stat statb;
                     26: 
                     27:        if (namlen >= sizeof buf)
                     28:                return((long)(errno=F_ERARG));
                     29:        g_char(name, namlen, buf);
                     30:        if (lstat(buf, &statb) == 0)
                     31:        {
                     32:                *stbuf++ = statb.st_dev;
                     33:                *stbuf++ = statb.st_ino;
                     34:                *stbuf++ = statb.st_mode;
                     35:                *stbuf++ = statb.st_nlink;
                     36:                *stbuf++ = statb.st_uid;
                     37:                *stbuf++ = statb.st_gid;
                     38:                *stbuf++ = statb.st_rdev;
                     39:                *stbuf++ = statb.st_size;
                     40:                *stbuf++ = statb.st_atime;
                     41:                *stbuf++ = statb.st_mtime;
                     42:                *stbuf++ = statb.st_ctime;
                     43:                *stbuf++ = statb.st_blksize;
                     44:                return(0L);
                     45:        }
                     46:        return ((long)errno);
                     47: }

unix.superglobalmegacorp.com

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