root/kern/include/kern/stat.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2008
   3  *      The President and Fellows of Harvard College.
   4  *
   5  * Redistribution and use in source and binary forms, with or without
   6  * modification, are permitted provided that the following conditions
   7  * are met:
   8  * 1. Redistributions of source code must retain the above copyright
   9  *    notice, this list of conditions and the following disclaimer.
  10  * 2. Redistributions in binary form must reproduce the above copyright
  11  *    notice, this list of conditions and the following disclaimer in the
  12  *    documentation and/or other materials provided with the distribution.
  13  * 3. Neither the name of the University nor the names of its contributors
  14  *    may be used to endorse or promote products derived from this software
  15  *    without specific prior written permission.
  16  *
  17  * THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
  18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
  21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27  * SUCH DAMAGE.
  28  */
  29 
  30 #ifndef _KERN_STAT_H_
  31 #define _KERN_STAT_H_
  32 
  33 /*
  34  * The stat structure, for returning file information via stat(),
  35  * fstat(), and lstat().
  36  *
  37  * Fields corresponding to things you aren't implementing should be
  38  * set to zero.
  39  *
  40  * The file types are in kern/stattypes.h.
  41  */
  42 struct stat {
  43         /* Essential fields */
  44         off_t st_size;          /* file size in bytes */
  45         mode_t st_mode;         /* file type and protection mode */
  46         nlink_t st_nlink;       /* number of hard links */
  47         blkcnt_t st_blocks;     /* number of blocks file is using */
  48 
  49         /* Identity */
  50         dev_t st_dev;           /* device object lives on */
  51         ino_t st_ino;           /* inode number (serial number) of object */
  52         dev_t st_rdev;          /* device object is (if a device) */
  53 
  54         /* Timestamps */
  55         time_t st_atime;        /* last access time: seconds */
  56         time_t st_ctime;        /* inode change time: seconds */
  57         time_t st_mtime;        /* modification time: seconds */
  58         __u32 st_atimensec;     /* last access time: nanoseconds */
  59         __u32 st_ctimensec;     /* inode change time: nanoseconds */
  60         __u32 st_mtimensec;     /* modification time: nanoseconds */
  61 
  62         /* Permissions (also st_mode) */
  63         uid_t st_uid;           /* owner */
  64         gid_t st_gid;           /* group */
  65 
  66         /* Other */
  67         __u32 st_gen;           /* file generation number (root only) */
  68         blksize_t st_blksize;   /* recommended I/O block size */
  69 };
  70 
  71 #endif /* _KERN_STAT_H_ */

/* [<][>][^][v][top][bottom][index][help] */