]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/mips/bits/stat.h
New file.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / mips / bits / stat.h
CommitLineData
afda9935 1/* Copyright (C) 1992, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
eec226c3
UD
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
90571408
UD
19#ifndef _SYS_STAT_H
20# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
21#endif
eec226c3
UD
22
23/* Versions of the `struct stat' data structure. */
24#define _STAT_VER_LINUX_OLD 1
8c082916 25#define _STAT_VER_KERNEL 1
eec226c3
UD
26#define _STAT_VER_SVR4 2
27#define _STAT_VER_LINUX 3
8c082916 28#define _STAT_VER _STAT_VER_LINUX /* The one defined below. */
eec226c3
UD
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
8c082916 35
eec226c3
UD
36/* Structure describing file characteristics. */
37struct stat
38 {
39 unsigned long int st_dev;
40 long int st_pad1[3];
3abeec50 41#ifndef __USE_FILE_OFFSET64
eec226c3 42 __ino_t st_ino; /* File serial number. */
3abeec50
UD
43#else
44 __ino64_t st_ino; /* File serial number. */
45#endif
eec226c3
UD
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. */
3abeec50 51#ifndef __USE_FILE_OFFSET64
546afa8c 52 long int st_pad2[2];
eec226c3 53 __off_t st_size; /* Size of file, in bytes. */
2489c7f1
AJ
54 /* SVR4 added this extra long to allow for expansion of off_t. */
55 long int st_pad3;
3abeec50 56#else
546afa8c 57 long int st_pad2[3];
3abeec50
UD
58 __off64_t st_size; /* Size of file, in bytes. */
59#endif
eec226c3
UD
60 /*
61 * Actually this should be timestruc_t st_atime, st_mtime and
62 * st_ctime but we don't have it under Linux.
63 */
64 __time_t st_atime; /* Time of last access. */
65 long int __reserved0;
66 __time_t st_mtime; /* Time of last modification. */
67 long int __reserved1;
68 __time_t st_ctime; /* Time of last status change. */
69 long int __reserved2;
69967934 70 __blksize_t st_blksize; /* Optimal block size for I/O. */
3abeec50
UD
71#ifndef __USE_FILE_OFFSET64
72 __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */
73#else
2489c7f1 74 long int st_pad4;
3abeec50
UD
75 __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */
76#endif
2489c7f1 77 long int st_pad4[14];
eec226c3
UD
78 };
79
3abeec50
UD
80#ifdef __USE_LARGEFILE64
81struct stat64
82 {
83 unsigned long int st_dev;
84 long int st_pad1[3];
85 __ino64_t st_ino; /* File serial number. */
86 __mode_t st_mode; /* File mode. */
87 __nlink_t st_nlink; /* Link count. */
88 __uid_t st_uid; /* User ID of the file's owner. */
89 __gid_t st_gid; /* Group ID of the file's group.*/
90 unsigned long int st_rdev; /* Device number, if device. */
546afa8c 91 long int st_pad2[3];
3abeec50 92 __off64_t st_size; /* Size of file, in bytes. */
3abeec50
UD
93 /*
94 * Actually this should be timestruc_t st_atime, st_mtime and
95 * st_ctime but we don't have it under Linux.
96 */
97 __time_t st_atime; /* Time of last access. */
98 long int __reserved0;
99 __time_t st_mtime; /* Time of last modification. */
100 long int __reserved1;
101 __time_t st_ctime; /* Time of last status change. */
102 long int __reserved2;
69967934 103 __blksize_t st_blksize; /* Optimal block size for I/O. */
2489c7f1 104 long int st_pad3;
3abeec50 105 __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */
2489c7f1 106 long int st_pad4[14];
3abeec50
UD
107 };
108#endif
109
649d6c33
UD
110/* Tell code we have these members. */
111#define _STATBUF_ST_BLKSIZE
112#define _STATBUF_ST_RDEV
eec226c3
UD
113
114/* Encoding of the file mode. */
115
116#define __S_IFMT 0170000 /* These bits determine file type. */
117
118/* File types. */
119#define __S_IFDIR 0040000 /* Directory. */
120#define __S_IFCHR 0020000 /* Character device. */
121#define __S_IFBLK 0060000 /* Block device. */
122#define __S_IFREG 0100000 /* Regular file. */
123#define __S_IFIFO 0010000 /* FIFO. */
eec226c3
UD
124#define __S_IFLNK 0120000 /* Symbolic link. */
125#define __S_IFSOCK 0140000 /* Socket. */
126
afda9935
UD
127/* POSIX.1b objects. */
128#define __S_TYPEISMQ(buf) (0)
129#define __S_TYPEISSEM(buf) (0)
130#define __S_TYPEISSHM(buf) (0)
131
eec226c3
UD
132/* Protection bits. */
133
134#define __S_ISUID 04000 /* Set user ID on execution. */
135#define __S_ISGID 02000 /* Set group ID on execution. */
136#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */
137#define __S_IREAD 0400 /* Read by owner. */
138#define __S_IWRITE 0200 /* Write by owner. */
139#define __S_IEXEC 0100 /* Execute by owner. */