home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / bsdss4.tz / bsdss4 / bsdss / server / ufs / dinode.h next >
Encoding:
C/C++ Source or Header  |  1992-04-22  |  4.8 KB  |  121 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1992 Carnegie Mellon University
  4.  * All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify and distribute this software and its
  7.  * documentation is hereby granted, provided that both the copyright
  8.  * notice and this permission notice appear in all copies of the
  9.  * software, derivative works or modified versions, and any portions
  10.  * thereof, and that both notices appear in supporting documentation.
  11.  * 
  12.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15.  * 
  16.  * Carnegie Mellon requests users of this software to return to
  17.  * 
  18.  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19.  *  School of Computer Science
  20.  *  Carnegie Mellon University
  21.  *  Pittsburgh PA 15213-3890
  22.  * 
  23.  * any improvements or extensions that they make and grant Carnegie Mellon 
  24.  * the rights to redistribute these changes.
  25.  */
  26. /*
  27.  * HISTORY
  28.  * $Log:    dinode.h,v $
  29.  * Revision 2.1  92/04/21  17:18:01  rwd
  30.  * BSDSS
  31.  * 
  32.  *
  33.  */
  34.  
  35. /*
  36.  * Copyright (c) 1982, 1989 The Regents of the University of California.
  37.  * All rights reserved.
  38.  *
  39.  * Redistribution and use in source and binary forms, with or without
  40.  * modification, are permitted provided that the following conditions
  41.  * are met:
  42.  * 1. Redistributions of source code must retain the above copyright
  43.  *    notice, this list of conditions and the following disclaimer.
  44.  * 2. Redistributions in binary form must reproduce the above copyright
  45.  *    notice, this list of conditions and the following disclaimer in the
  46.  *    documentation and/or other materials provided with the distribution.
  47.  * 3. All advertising materials mentioning features or use of this software
  48.  *    must display the following acknowledgement:
  49.  *    This product includes software developed by the University of
  50.  *    California, Berkeley and its contributors.
  51.  * 4. Neither the name of the University nor the names of its contributors
  52.  *    may be used to endorse or promote products derived from this software
  53.  *    without specific prior written permission.
  54.  *
  55.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  56.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  57.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  58.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  59.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  60.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  61.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  62.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  63.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  64.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  65.  * SUCH DAMAGE.
  66.  *
  67.  *    @(#)dinode.h    7.10 (Berkeley) 5/8/91
  68.  */
  69.  
  70. /*
  71.  * A dinode contains all the meta-data associated with a UFS file.
  72.  * This structure defines the on-disk format of a dinode.
  73.  */
  74.  
  75. #define    NDADDR    12        /* direct addresses in inode */
  76. #define    NIADDR    3        /* indirect addresses in inode */
  77.  
  78. struct dinode {
  79.     u_short    di_mode;    /*  0: mode and type of file */
  80.     short    di_nlink;    /*  2: number of links to file */
  81.     uid_t    di_uid;        /*  4: owner's user id */
  82.     gid_t    di_gid;        /*  6: owner's group id */
  83.     u_quad    di_qsize;    /*  8: number of bytes in file */
  84.     time_t    di_atime;    /* 16: time last accessed */
  85.     long    di_atspare;
  86.     time_t    di_mtime;    /* 24: time last modified */
  87.     long    di_mtspare;
  88.     time_t    di_ctime;    /* 32: last time inode changed */
  89.     long    di_ctspare;
  90.     daddr_t    di_db[NDADDR];    /* 40: disk block addresses */
  91.     daddr_t    di_ib[NIADDR];    /* 88: indirect blocks */
  92.     long    di_flags;    /* 100: status, currently unused */
  93.     long    di_blocks;    /* 104: blocks actually held */
  94.     long    di_gen;        /* 108: generation number */
  95.     long    di_spare[4];    /* 112: reserved, currently unused */
  96. };
  97.  
  98. #if BYTE_ORDER == LITTLE_ENDIAN || defined(tahoe) /* ugh! -- must be fixed */
  99. #define    di_size        di_qsize.val[0]
  100. #else /* BYTE_ORDER == BIG_ENDIAN */
  101. #define    di_size        di_qsize.val[1]
  102. #endif
  103. #define    di_rdev        di_db[0]
  104.  
  105. /* file modes */
  106. #define    IFMT        0170000        /* mask of file type */
  107. #define    IFIFO        0010000        /* named pipe (fifo) */
  108. #define    IFCHR        0020000        /* character special device */
  109. #define    IFDIR        0040000        /* directory */
  110. #define    IFBLK        0060000        /* block special device */
  111. #define    IFREG        0100000        /* regular file */
  112. #define    IFLNK        0120000        /* symbolic link */
  113. #define    IFSOCK        0140000        /* UNIX domain socket */
  114.  
  115. #define    ISUID        04000        /* set user identifier when exec'ing */
  116. #define    ISGID        02000        /* set group identifier when exec'ing */
  117. #define    ISVTX        01000        /* save execution information on exit */
  118. #define    IREAD        0400        /* read permission */
  119. #define    IWRITE        0200        /* write permission */
  120. #define    IEXEC        0100        /* execute permission */
  121.