]> sourceware.org Git - glibc.git/blob - sysdeps/unix/sysv/linux/mips/bits/stat.h
Update.
[glibc.git] / sysdeps / unix / sysv / linux / mips / bits / stat.h
1 /* Copyright (C) 1992, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
18
19 #ifndef _SYS_STAT_H
20 # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
21 #endif
22
23 /* Versions of the `struct stat' data structure. */
24 #define _STAT_VER_LINUX_OLD 1
25 #define _STAT_VER_KERNEL 1
26 #define _STAT_VER_SVR4 2
27 #define _STAT_VER_LINUX 3
28 #define _STAT_VER _STAT_VER_LINUX /* The one defined below. */
29
30 /* Versions of the `xmknod' interface. */
31 #define _MKNOD_VER_LINUX 1
32 #define _MKNOD_VER_SVR4 2
33 #define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */
34
35
36 /* Structure describing file characteristics. */
37 struct stat
38 {
39 unsigned long int st_dev;
40 long int st_pad1[3];
41 #ifndef __USE_FILE_OFFSET64
42 __ino_t st_ino; /* File serial number. */
43 #else
44 __ino64_t st_ino; /* File serial number. */
45 #endif
46 __mode_t st_mode; /* File mode. */
47 __nlink_t st_nlink; /* Link count. */
48 __uid_t st_uid; /* User ID of the file's owner. */
49 __gid_t st_gid; /* Group ID of the file's group.*/
50 unsigned long int st_rdev; /* Device number, if device. */
51 long int st_pad2[2];
52 #ifndef __USE_FILE_OFFSET64
53 __off_t st_size; /* Size of file, in bytes. */
54 #else
55 __off64_t st_size; /* Size of file, in bytes. */
56 #endif
57 /* SVR4 added this extra long to allow for expansion of off_t. */
58 long int st_pad3;
59 /*
60 * Actually this should be timestruc_t st_atime, st_mtime and
61 * st_ctime but we don't have it under Linux.
62 */
63 __time_t st_atime; /* Time of last access. */
64 long int __reserved0;
65 __time_t st_mtime; /* Time of last modification. */
66 long int __reserved1;
67 __time_t st_ctime; /* Time of last status change. */
68 long int __reserved2;
69 __blksize_t st_blksize; /* Optimal block size for I/O. */
70 #ifndef __USE_FILE_OFFSET64
71 __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */
72 #else
73 __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */
74 #endif
75 char st_fstype[16]; /* Filesystem type name */
76 long int st_pad4[8];
77 /* Linux specific fields */
78 unsigned int st_flags;
79 unsigned int st_gen;
80 };
81
82 #ifdef __USE_LARGEFILE64
83 struct stat64
84 {
85 unsigned long int st_dev;
86 long int st_pad1[3];
87 __ino64_t st_ino; /* File serial number. */
88 __mode_t st_mode; /* File mode. */
89 __nlink_t st_nlink; /* Link count. */
90 __uid_t st_uid; /* User ID of the file's owner. */
91 __gid_t st_gid; /* Group ID of the file's group.*/
92 unsigned long int st_rdev; /* Device number, if device. */
93 long int st_pad2[2];
94 __off64_t st_size; /* Size of file, in bytes. */
95 /* SVR4 added this extra long to allow for expansion of off_t. */
96 long int st_pad3;
97 /*
98 * Actually this should be timestruc_t st_atime, st_mtime and
99 * st_ctime but we don't have it under Linux.
100 */
101 __time_t st_atime; /* Time of last access. */
102 long int __reserved0;
103 __time_t st_mtime; /* Time of last modification. */
104 long int __reserved1;
105 __time_t st_ctime; /* Time of last status change. */
106 long int __reserved2;
107 __blksize_t st_blksize; /* Optimal block size for I/O. */
108 __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */
109 char st_fstype[16]; /* Filesystem type name */
110 long int st_pad4[8];
111 /* Linux specific fields */
112 unsigned int st_flags;
113 unsigned int st_gen;
114 };
115 #endif
116
117 /* Tell code we have these members. */
118 #define _STATBUF_ST_BLKSIZE
119 #define _STATBUF_ST_RDEV
120
121 /* Encoding of the file mode. */
122
123 #define __S_IFMT 0170000 /* These bits determine file type. */
124
125 /* File types. */
126 #define __S_IFDIR 0040000 /* Directory. */
127 #define __S_IFCHR 0020000 /* Character device. */
128 #define __S_IFBLK 0060000 /* Block device. */
129 #define __S_IFREG 0100000 /* Regular file. */
130 #define __S_IFIFO 0010000 /* FIFO. */
131 #define __S_IFLNK 0120000 /* Symbolic link. */
132 #define __S_IFSOCK 0140000 /* Socket. */
133
134 /* POSIX.1b objects. */
135 #define __S_TYPEISMQ(buf) (0)
136 #define __S_TYPEISSEM(buf) (0)
137 #define __S_TYPEISSHM(buf) (0)
138
139 /* Protection bits. */
140
141 #define __S_ISUID 04000 /* Set user ID on execution. */
142 #define __S_ISGID 02000 /* Set group ID on execution. */
143 #define __S_ISVTX 01000 /* Save swapped text after use (sticky). */
144 #define __S_IREAD 0400 /* Read by owner. */
145 #define __S_IWRITE 0200 /* Write by owner. */
146 #define __S_IEXEC 0100 /* Execute by owner. */
This page took 0.04768 seconds and 6 git commands to generate.