Annotation of 43BSD/usr.lib/libU77/lstat_.c, revision 1.1

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

unix.superglobalmegacorp.com

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