🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: mod.computers.apollo
2 messages
2 total messages Started by Neal Holtz Sat, 28 Dec 1985 01:31
Bug in "struct stat"
#58
Author: Neal Holtz
Date: Sat, 28 Dec 1985 01:31
45 lines
2504 bytes
A warning, though I suspect its been discovered many times.
The header file <sys/stat.h> that we got with Aegis SR9 CC is
wrong.  stat(3)  (BSD4.2 version) returns a few more words
of data than the header file leaves room for.  Nasty.  The
correct version seems to be (as in the CLIB manual, page 3-72 BSD4.2):

/*  stat.h, /usr/include, 06/19/85
    stat structure and related flags

    Changes:
        06/19/85 jrw  original coding.  */


/*  stat buffer -- returned from stat(2):  */

struct  stat {
        dev_t   st_dev;         /* device id */
        ino_t   st_ino;         /* inode number */
        ushort  st_mode;        /* mode (see below) */
        short   st_nlink;       /* # links */
        ushort  st_uid;         /* uid of owner */
        ushort  st_gid;         /* gid of owner */
        dev_t   st_rdev;        /* dev id for b/c spec files */
        off_t   st_size;        /* file size, in bytes */
        time_t  st_atime;       /* data access time */
        time_t  st_mtime;       /* data mod time */
        time_t  st_ctime;       /* attribute mod time */
};


/*  st_mode word definition:  */

#define S_IFMT  0170000         /* format mask: */
#define         S_IFDIR 0040000     /* directory */
#define         S_IFCHR 0020000     /* character special */
#define         S_IFBLK 0060000     /* block special */
#define         S_IFREG 0100000     /* regular */
#define         S_IFIFO 0010000     /* pipe (fifo) */

#define S_ISUID  04000          /* set user id on execution */
#define S_ISGID  02000          /* set group id on execution */
#define S_ISVTX  01000          /* save pure text (sticky bit; unimplemented) */
#define S_IREAD  00400          /* read  (owner) */
#define S_IWRITE 00200          /* write  (owner) */
#define S_IEXEC  00100          /* execute (file) | search (dir) (owner) */
Re: Bug in "struct stat"
#63
Author: apollo
Date: Sat, 04 Jan 1986 03:11
6 lines
870 bytes
WOW.  Jim Ward lives on !!!!
-- 
Bob Ollerton; Celerity Computing; 
9692 Via Excelencia; San Diego, Ca 92126; (619) 271 9940
{decvax || ucbvax || ihnp4}!sdcsvax!celerity!bobbyo
                              akgua!celerity!bobbyo
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads