Back to index

glibc  2.9
stat.h
Go to the documentation of this file.
00001 /* Copyright (C) 1992, 1996, 1997, 2000 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #ifndef _SYS_STAT_H
00020 # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
00021 #endif
00022 
00023 struct stat
00024   {
00025     unsigned long st_ino;
00026     short int st_dev;
00027     unsigned short int st_mode;
00028     short int st_nlink;
00029     unsigned short int st_uid;
00030     unsigned short int st_gid;
00031     short int st_rdev;
00032     long int st_size;
00033     long int st_atime;
00034     long int st_mtime;
00035     long int st_ctime;
00036   };
00037 
00038 /* Encoding of the file mode.  */
00039 
00040 #define       __S_IFMT      0170000       /* These bits determine file type.  */
00041 
00042 /* File types.  */
00043 #define       __S_IFDIR     0040000       /* Directory.  */
00044 #define       __S_IFCHR     0020000       /* Character device.  */
00045 #define       __S_IFBLK     0060000       /* Block device.  */
00046 #define       __S_IFREG     0100000       /* Regular file.  */
00047 #define       __S_IFIFO     0010000       /* FIFO.  */
00048 
00049 /* These don't actually exist on System V, but having them doesn't hurt.  */
00050 #define       __S_IFLNK     0120000       /* Symbolic link.  */
00051 #define       __S_IFSOCK    0140000       /* Socket.  */
00052 
00053 /* POSIX.1b objects.  */
00054 #define __S_TYPEISMQ(buf) (0)
00055 #define __S_TYPEISSEM(buf) (0)
00056 #define __S_TYPEISSHM(buf) (0)
00057 
00058 /* Protection bits.  */
00059 
00060 #define       __S_ISUID     04000  /* Set user ID on execution.  */
00061 #define       __S_ISGID     02000  /* Set group ID on execution.  */
00062 #define       __S_ISVTX     01000  /* Save swapped text after use (sticky).  */
00063 #define       __S_IREAD     0400   /* Read by owner.  */
00064 #define       __S_IWRITE    0200   /* Write by owner.  */
00065 #define       __S_IEXEC     0100   /* Execute by owner.  */