|
|
1.1 root 1: /*
2: * Copyright (c) 1982, 1989 The Regents of the University of California.
3: * All rights reserved.
4: *
5: * Redistribution is only permitted until one year after the first shipment
6: * of 4.4BSD by the Regents. Otherwise, redistribution and use in source and
7: * binary forms are permitted provided that: (1) source distributions retain
8: * this entire copyright notice and comment, and (2) distributions including
9: * binaries display the following acknowledgement: This product includes
10: * software developed by the University of California, Berkeley and its
11: * contributors'' in the documentation or other materials provided with the
12: * distribution and in all advertising materials mentioning features or use
13: * of this software. Neither the name of the University nor the names of
14: * its contributors may be used to endorse or promote products derived from
15: * this software without specific prior written permission.
16: * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
17: * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19: *
20: * @(#)dinode.h 7.9 (Berkeley) 6/28/90
21: */
22:
23: /*
24: * This structure defines the on-disk format of an inode.
25: */
26:
27: #define NDADDR 12 /* direct addresses in inode */
28: #define NIADDR 3 /* indirect addresses in inode */
29:
30: struct dinode {
31: u_short di_mode; /* 0: mode and type of file */
32: short di_nlink; /* 2: number of links to file */
33: uid_t di_uid; /* 4: owner's user id */
34: gid_t di_gid; /* 6: owner's group id */
35: u_quad di_qsize; /* 8: number of bytes in file */
36: time_t di_atime; /* 16: time last accessed */
37: long di_atspare;
38: time_t di_mtime; /* 24: time last modified */
39: long di_mtspare;
40: time_t di_ctime; /* 32: last time inode changed */
41: long di_ctspare;
42: daddr_t di_db[NDADDR]; /* 40: disk block addresses */
43: daddr_t di_ib[NIADDR]; /* 88: indirect blocks */
44: long di_flags; /* 100: status, currently unused */
45: long di_blocks; /* 104: blocks actually held */
46: long di_gen; /* 108: generation number */
47: long di_spare[4]; /* 112: reserved, currently unused */
48: };
49:
50: #if BYTE_ORDER == LITTLE_ENDIAN || defined(tahoe) /* ugh! -- must be fixed */
51: #define di_size di_qsize.val[0]
52: #else /* BYTE_ORDER == BIG_ENDIAN */
53: #define di_size di_qsize.val[1]
54: #endif
55: #define di_rdev di_db[0]
56:
57: /* file modes */
58: #define IFMT 0170000 /* type of file */
59: #define IFIFO 0010000 /* named pipe (fifo) */
60: #define IFCHR 0020000 /* character special */
61: #define IFDIR 0040000 /* directory */
62: #define IFBLK 0060000 /* block special */
63: #define IFREG 0100000 /* regular */
64: #define IFLNK 0120000 /* symbolic link */
65: #define IFSOCK 0140000 /* socket */
66:
67: #define ISUID 04000 /* set user id on execution */
68: #define ISGID 02000 /* set group id on execution */
69: #define ISVTX 01000 /* save swapped text even after use */
70: #define IREAD 0400 /* read, write, execute permissions */
71: #define IWRITE 0200
72: #define IEXEC 0100
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.