OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [include/] [sys/] [stat.h] - Blame information for rev 199

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
#ifndef _SYS_STAT_H
2
#define _SYS_STAT_H
3
 
4
#include <features.h>
5
#include <sys/types.h>
6
#undef __NOT_KERNEL
7
#define __NOT_KERNEL
8
#include <linux/stat.h>
9
#undef __NOT_KERNEL
10
 
11
#ifdef __SVR4_I386_ABI_L1__
12
#include <sys/time.h>           /* For timestruc_t */
13
#endif /* __SVR4_I386_ABI_L1__ */
14
 
15
__BEGIN_DECLS
16
 
17
struct stat {
18
        dev_t           st_dev;
19
 
20
#ifdef __SVR4_I386_ABI_L1__
21
        long st_pad1[3];
22
#else
23
        unsigned short __pad1;
24
#endif
25
 
26
        ino_t           st_ino;
27
        umode_t         st_mode;
28
        nlink_t         st_nlink;
29
        uid_t           st_uid;
30
        gid_t           st_gid;
31
        dev_t           st_rdev;
32
 
33
#ifdef __SVR4_I386_ABI_L1__
34
        long st_pad2[2];
35
#else
36
        unsigned short __pad2;
37
#endif
38
 
39
        off_t           st_size;
40
 
41
#ifdef __SVR4_I386_ABI_L1__
42
        timestruc_t     st_atim;
43
        timestruc_t     st_mtim;
44
        timestruc_t     st_ctim;
45
        long            st_blksize;
46
        long            st_blocks;
47
 
48
#define FSTYPSZ         16
49
 
50
        char            st_fstype[FSTYPSZ];
51
        long            st_pad4[8];
52
 
53
#define st_atime        st_atim.tv_sec
54
#define st_mtime        st_mtim.tv_sec
55
#define st_ctime        st_ctim.tv_sec
56
 
57
#else /*! __SVR4_I386_ABI_L1__*/
58
        unsigned long   st_blksize;
59
        unsigned long   st_blocks;
60
        time_t          st_atime;
61
        unsigned long   __unused1;
62
        time_t          st_mtime;
63
        unsigned long   __unused2;
64
        time_t          st_ctime;
65
        unsigned long   __unused3;
66
        unsigned long   __unused4;
67
        unsigned long   __unused5;
68
#endif /*! __SVR4_I386_ABI_L1__*/
69
};
70
 
71
 
72
#define LINUX_MKNOD_VERSION 1     /* SVr4 */
73
#define LINUX_STAT_VERSION 1      /* SVr4 */
74
 
75
extern int _fxstat __P ((int __ver, int __fildes,
76
                        struct stat *__stat_buf));
77
 
78
extern int _xstat __P ((int __ver, __const char *__filename,
79
                        struct stat *__stat_buf));
80
 
81
extern int _lxstat __P ((int __ver, __const char *__filename,
82
                        struct stat *__stat_buf));
83
 
84
#ifdef _MIT_POSIX_THREADS
85
extern int __machdep_sys__fxstat __P ((int __ver, int __fd,
86
                        struct stat *__stat_buf));
87
#endif
88
 
89
extern int _xmknod __P ((int __ver, __const char *__path,
90
                        mode_t __mode, dev_t *__dev));
91
 
92
/* Some synonyms used historically in the kernel and elsewhere */
93
#define S_IREAD         S_IRUSR /* read permission, owner */
94
#define S_IWRITE        S_IWUSR /* write permission, owner */
95
#define S_IEXEC         S_IXUSR /* execute/search permission, owner */
96
 
97
extern int      __chmod __P ((__const char *__path, mode_t __mode));
98
extern int      chmod __P ((__const char *__path, mode_t __mode));
99
 
100
extern int      __fchmod __P ((int __fildes, mode_t __mode));
101
extern int      fchmod __P ((int __fildes, mode_t __mode));
102
 
103
extern int      __mkdir __P ((__const char *__path, mode_t __mode));
104
extern int      mkdir __P ((__const char *__path, mode_t __mode));
105
 
106
extern int      mkfifo __P ((__const char *__path, mode_t __mode));
107
 
108
#if 1
109
 
110
extern int      __fstat __P ((int __fildes, struct stat *__stat_buf));
111
extern int      fstat __P ((int __fildes, struct stat *__stat_buf));
112
 
113
extern int      __stat __P ((__const char *__filename,
114
                        struct stat *__stat_buf));
115
extern int      stat __P ((__const char *__filename,
116
                        struct stat *__stat_buf));
117
 
118
extern int      __lstat __P ((__const char *__filename,
119
                        struct stat *__stat_buf));
120
extern int      lstat __P ((__const char *__filename,
121
                        struct stat *__stat_buf));
122
 
123
extern int      __mknod __P ((__const char *__path, mode_t __mode,
124
                        dev_t __dev));
125
extern int      mknod __P ((__const char *__path, mode_t __mode,
126
                        dev_t __dev));
127
#endif          /* #if 0 */
128
 
129
extern mode_t   __umask __P ((mode_t __mask));
130
extern mode_t   umask __P ((mode_t __mask));
131
 
132
__END_DECLS
133
 
134
#if 0
135
 
136
static __inline__ int __stat(__const char * __path, struct stat * __statbuf)
137
{
138
  return _xstat(LINUX_STAT_VERSION, __path, __statbuf);
139
}
140
 
141
static __inline__ int stat(__const char * __path, struct stat * __statbuf)
142
{
143
  return _xstat(LINUX_STAT_VERSION, __path, __statbuf);
144
}
145
 
146
static __inline__ int __lstat(__const char * __path, struct stat * __statbuf)
147
{
148
  return _lxstat(LINUX_STAT_VERSION, __path, __statbuf);
149
}
150
 
151
static __inline__ int lstat(__const char * __path, struct stat * __statbuf)
152
{
153
  return _lxstat(LINUX_STAT_VERSION, __path, __statbuf);
154
}
155
 
156
static __inline__ int __fstat(int __fd, struct stat * __statbuf)
157
{
158
  return _fxstat(LINUX_STAT_VERSION, __fd, __statbuf);
159
}
160
 
161
static __inline__ int fstat(int __fd, struct stat * __statbuf)
162
{
163
  return _fxstat(LINUX_STAT_VERSION, __fd, __statbuf);
164
}
165
 
166
static __inline__ int __mknod(__const char * __path, mode_t __mode, dev_t __dev)
167
{
168
  return _xmknod(LINUX_MKNOD_VERSION, __path, __mode, &__dev);
169
}
170
 
171
static __inline__ int mknod(__const char * __path, mode_t __mode, dev_t __dev)
172
{
173
  return _xmknod(LINUX_MKNOD_VERSION, __path, __mode, &__dev);
174
}
175
 
176
#ifdef _MIT_POSIX_THREADS
177
 
178
static __inline__ int __machdep_sys_fstat(int __fd, struct stat * __statbuf)
179
{
180
  return __machdep_sys__fxstat(LINUX_STAT_VERSION, __fd, __statbuf);
181
}
182
 
183
static __inline__ int machdep_sys_fstat(int __fd, struct stat * __statbuf)
184
{
185
  return __machdep_sys__fxstat(LINUX_STAT_VERSION, __fd, __statbuf);
186
}
187
 
188
#endif
189
 
190
#endif
191
 
192
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.