Annotation of 43BSDTahoe/usr.lib/libU77/fstat_.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:  *     @(#)fstat_.c    5.1     6/7/85
        !             7:  */
        !             8: 
        !             9: /*
        !            10:  * get file status
        !            11:  *
        !            12:  * calling sequence:
        !            13:  *     integer fstat, statb(12)
        !            14:  *     call fstat (name, statb)
        !            15:  * where:
        !            16:  *     'statb' will receive the stat structure for file 'name'.
        !            17:  */
        !            18: 
        !            19: #include <sys/types.h>
        !            20: #include <sys/stat.h>
        !            21: #include "../libI77/f_errno.h"
        !            22: #include "../libI77/fiodefs.h"
        !            23: 
        !            24: extern unit units[];
        !            25: 
        !            26: long fstat_(lunit, stbuf)
        !            27: long *lunit, *stbuf;
        !            28: {
        !            29:        struct stat statb;
        !            30: 
        !            31:        if (*lunit < 0 || *lunit >= MXUNIT)
        !            32:                return((long)(errno=F_ERUNIT));
        !            33:        if (!units[*lunit].ufd)
        !            34:                return((long)(errno=F_ERNOPEN));
        !            35:        if (fstat(fileno(units[*lunit].ufd), &statb) == 0)
        !            36:        {
        !            37:                *stbuf++ = statb.st_dev;
        !            38:                *stbuf++ = statb.st_ino;
        !            39:                *stbuf++ = statb.st_mode;
        !            40:                *stbuf++ = statb.st_nlink;
        !            41:                *stbuf++ = statb.st_uid;
        !            42:                *stbuf++ = statb.st_gid;
        !            43:                *stbuf++ = statb.st_rdev;
        !            44:                *stbuf++ = statb.st_size;
        !            45:                *stbuf++ = statb.st_atime;
        !            46:                *stbuf++ = statb.st_mtime;
        !            47:                *stbuf++ = statb.st_ctime;
        !            48:                *stbuf++ = statb.st_blksize;
        !            49:                return(0L);
        !            50:        }
        !            51:        return ((long)errno);
        !            52: }

unix.superglobalmegacorp.com

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