]>
git.ipfire.org Git - thirdparty/glibc.git/blob - ports/sysdeps/unix/sysv/linux/mips/bits/stat.h
becb4282ce16cf37b44ada356570e60bf0bf0ea1
1 /* Copyright (C) 1992-2013 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
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 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library. If not, see
16 <http://www.gnu.org/licenses/>. */
18 #if !defined _SYS_STAT_H && !defined _FCNTL_H
19 # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
23 #define _BITS_STAT_H 1
27 /* Versions of the `struct stat' data structure. */
28 #define _STAT_VER_LINUX_OLD 1
29 #define _STAT_VER_KERNEL 1
30 #define _STAT_VER_SVR4 2
31 #define _STAT_VER_LINUX 3
32 #define _STAT_VER _STAT_VER_LINUX /* The one defined below. */
34 /* Versions of the `xmknod' interface. */
35 #define _MKNOD_VER_LINUX 1
36 #define _MKNOD_VER_SVR4 2
37 #define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */
40 #if _MIPS_SIM == _ABIO32
41 /* Structure describing file characteristics. */
44 unsigned long int st_dev
;
46 #ifndef __USE_FILE_OFFSET64
47 __ino_t st_ino
; /* File serial number. */
49 __ino64_t st_ino
; /* File serial number. */
51 __mode_t st_mode
; /* File mode. */
52 __nlink_t st_nlink
; /* Link count. */
53 __uid_t st_uid
; /* User ID of the file's owner. */
54 __gid_t st_gid
; /* Group ID of the file's group.*/
55 unsigned long int st_rdev
; /* Device number, if device. */
56 #ifndef __USE_FILE_OFFSET64
58 __off_t st_size
; /* Size of file, in bytes. */
59 /* SVR4 added this extra long to allow for expansion of off_t. */
63 __off64_t st_size
; /* Size of file, in bytes. */
65 #if defined __USE_MISC || defined __USE_XOPEN2K8
66 /* Nanosecond resolution timestamps are stored in a format
67 equivalent to 'struct timespec'. This is the type used
68 whenever possible but the Unix namespace rules do not allow the
69 identifier 'timespec' to appear in the <sys/stat.h> header.
70 Therefore we have to handle the use of this header in strictly
71 standard-compliant sources special. */
72 struct timespec st_atim
; /* Time of last access. */
73 struct timespec st_mtim
; /* Time of last modification. */
74 struct timespec st_ctim
; /* Time of last status change. */
75 # define st_atime st_atim.tv_sec /* Backward compatibility. */
76 # define st_mtime st_mtim.tv_sec
77 # define st_ctime st_ctim.tv_sec
79 __time_t st_atime
; /* Time of last access. */
80 unsigned long int st_atimensec
; /* Nscecs of last access. */
81 __time_t st_mtime
; /* Time of last modification. */
82 unsigned long int st_mtimensec
; /* Nsecs of last modification. */
83 __time_t st_ctime
; /* Time of last status change. */
84 unsigned long int st_ctimensec
; /* Nsecs of last status change. */
86 __blksize_t st_blksize
; /* Optimal block size for I/O. */
87 #ifndef __USE_FILE_OFFSET64
88 __blkcnt_t st_blocks
; /* Number of 512-byte blocks allocated. */
91 __blkcnt64_t st_blocks
; /* Number of 512-byte blocks allocated. */
96 #ifdef __USE_LARGEFILE64
99 unsigned long int st_dev
;
101 __ino64_t st_ino
; /* File serial number. */
102 __mode_t st_mode
; /* File mode. */
103 __nlink_t st_nlink
; /* Link count. */
104 __uid_t st_uid
; /* User ID of the file's owner. */
105 __gid_t st_gid
; /* Group ID of the file's group.*/
106 unsigned long int st_rdev
; /* Device number, if device. */
108 __off64_t st_size
; /* Size of file, in bytes. */
109 # if defined __USE_MISC || defined __USE_XOPEN2K8
110 /* Nanosecond resolution timestamps are stored in a format
111 equivalent to 'struct timespec'. This is the type used
112 whenever possible but the Unix namespace rules do not allow the
113 identifier 'timespec' to appear in the <sys/stat.h> header.
114 Therefore we have to handle the use of this header in strictly
115 standard-compliant sources special. */
116 struct timespec st_atim
; /* Time of last access. */
117 struct timespec st_mtim
; /* Time of last modification. */
118 struct timespec st_ctim
; /* Time of last status change. */
120 __time_t st_atime
; /* Time of last access. */
121 unsigned long int st_atimensec
; /* Nscecs of last access. */
122 __time_t st_mtime
; /* Time of last modification. */
123 unsigned long int st_mtimensec
; /* Nsecs of last modification. */
124 __time_t st_ctime
; /* Time of last status change. */
125 unsigned long int st_ctimensec
; /* Nsecs of last status change. */
127 __blksize_t st_blksize
; /* Optimal block size for I/O. */
129 __blkcnt64_t st_blocks
; /* Number of 512-byte blocks allocated. */
130 long int st_pad4
[14];
137 int st_pad1
[3]; /* Reserved for st_dev expansion */
138 #ifndef __USE_FILE_OFFSET64
148 #if !defined __USE_FILE_OFFSET64
149 unsigned int st_pad2
[2]; /* Reserved for st_rdev expansion */
153 unsigned int st_pad2
[3]; /* Reserved for st_rdev expansion */
156 #if defined __USE_MISC || defined __USE_XOPEN2K8
157 /* Nanosecond resolution timestamps are stored in a format
158 equivalent to 'struct timespec'. This is the type used
159 whenever possible but the Unix namespace rules do not allow the
160 identifier 'timespec' to appear in the <sys/stat.h> header.
161 Therefore we have to handle the use of this header in strictly
162 standard-compliant sources special. */
163 struct timespec st_atim
; /* Time of last access. */
164 struct timespec st_mtim
; /* Time of last modification. */
165 struct timespec st_ctim
; /* Time of last status change. */
166 # define st_atime st_atim.tv_sec /* Backward compatibility. */
167 # define st_mtime st_mtim.tv_sec
168 # define st_ctime st_ctim.tv_sec
170 __time_t st_atime
; /* Time of last access. */
171 unsigned long int st_atimensec
; /* Nscecs of last access. */
172 __time_t st_mtime
; /* Time of last modification. */
173 unsigned long int st_mtimensec
; /* Nsecs of last modification. */
174 __time_t st_ctime
; /* Time of last status change. */
175 unsigned long int st_ctimensec
; /* Nsecs of last status change. */
177 __blksize_t st_blksize
;
178 unsigned int st_pad4
;
179 #ifndef __USE_FILE_OFFSET64
180 __blkcnt_t st_blocks
;
182 __blkcnt64_t st_blocks
;
187 #ifdef __USE_LARGEFILE64
191 unsigned int st_pad1
[3]; /* Reserved for st_dev expansion */
198 unsigned int st_pad2
[3]; /* Reserved for st_rdev expansion */
200 # if defined __USE_MISC || defined __USE_XOPEN2K8
201 /* Nanosecond resolution timestamps are stored in a format
202 equivalent to 'struct timespec'. This is the type used
203 whenever possible but the Unix namespace rules do not allow the
204 identifier 'timespec' to appear in the <sys/stat.h> header.
205 Therefore we have to handle the use of this header in strictly
206 standard-compliant sources special. */
207 struct timespec st_atim
; /* Time of last access. */
208 struct timespec st_mtim
; /* Time of last modification. */
209 struct timespec st_ctim
; /* Time of last status change. */
211 __time_t st_atime
; /* Time of last access. */
212 unsigned long int st_atimensec
; /* Nscecs of last access. */
213 __time_t st_mtime
; /* Time of last modification. */
214 unsigned long int st_mtimensec
; /* Nsecs of last modification. */
215 __time_t st_ctime
; /* Time of last status change. */
216 unsigned long int st_ctimensec
; /* Nsecs of last status change. */
218 __blksize_t st_blksize
;
219 unsigned int st_pad3
;
220 __blkcnt64_t st_blocks
;
226 /* Tell code we have these members. */
227 #define _STATBUF_ST_BLKSIZE
228 #define _STATBUF_ST_RDEV
230 /* Encoding of the file mode. */
232 #define __S_IFMT 0170000 /* These bits determine file type. */
235 #define __S_IFDIR 0040000 /* Directory. */
236 #define __S_IFCHR 0020000 /* Character device. */
237 #define __S_IFBLK 0060000 /* Block device. */
238 #define __S_IFREG 0100000 /* Regular file. */
239 #define __S_IFIFO 0010000 /* FIFO. */
240 #define __S_IFLNK 0120000 /* Symbolic link. */
241 #define __S_IFSOCK 0140000 /* Socket. */
243 /* POSIX.1b objects. Note that these macros always evaluate to zero. But
244 they do it by enforcing the correct use of the macros. */
245 #define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode)
246 #define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
247 #define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
249 /* Protection bits. */
251 #define __S_ISUID 04000 /* Set user ID on execution. */
252 #define __S_ISGID 02000 /* Set group ID on execution. */
253 #define __S_ISVTX 01000 /* Save swapped text after use (sticky). */
254 #define __S_IREAD 0400 /* Read by owner. */
255 #define __S_IWRITE 0200 /* Write by owner. */
256 #define __S_IEXEC 0100 /* Execute by owner. */
259 # define UTIME_NOW ((1l << 30) - 1l)
260 # define UTIME_OMIT ((1l << 30) - 2l)
263 #endif /* bits/stat.h */