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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [newlib/] [newlib/] [libc/] [sys/] [sparc64/] [sys/] [stat.h] - Blame information for rev 1765

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

Line No. Rev Author Line
1 39 lampret
#ifndef _SYS_STAT_H
2
#define _SYS_STAT_H
3
 
4
#ifdef __cplusplus
5
extern "C" {
6
#endif
7
 
8
#include <_ansi.h>
9
#include <sys/types.h>
10
 
11
#ifdef __svr4__
12
 
13
#include <sys/time.h>
14
 
15
#define _ST_FSTYPSZ 16          /* array size for file system type name */
16
 
17
struct  stat
18
{
19
  dev_t         st_dev;
20
  long          st_pad1[3];     /* reserved for network id */
21
  ino_t         st_ino;
22
  mode_t        st_mode;
23
  nlink_t       st_nlink;
24
  uid_t         st_uid;
25
  gid_t         st_gid;
26
  dev_t         st_rdev;
27
  long          st_pad2[2];
28
  off_t         st_size;
29
  long          st_pad3;        /* future off_t expansion */
30
  timestruc_t   st_atim;
31
  timestruc_t   st_mtim;
32
  timestruc_t   st_ctim;
33
  long          st_blksize;
34
  long          st_blocks;
35
  char          st_fstype[_ST_FSTYPSZ];
36
  long          st_pad4[8];     /* expansion area */
37
};
38
 
39
#define st_atime        st_atim.tv_sec
40
#define st_mtime        st_mtim.tv_sec
41
#define st_ctime        st_ctim.tv_sec
42
 
43
#else
44
 
45
#include <time.h>
46
 
47
struct  stat
48
{
49
  dev_t         st_dev;
50
  ino_t         st_ino;
51
  mode_t        st_mode;
52
  short         st_nlink;
53
  uid_t         st_uid;
54
  gid_t         st_gid;
55
  dev_t         st_rdev;
56
  off_t         st_size;
57
  time_t        st_atime;
58
  int           st_spare1;
59
  time_t        st_mtime;
60
  int           st_spare2;
61
  time_t        st_ctime;
62
  int           st_spare3;
63
  long          st_blksize;
64
  long          st_blocks;
65
  long          st_spare4[2];
66
};
67
 
68
#endif
69
 
70
#define _IFMT           0170000 /* type of file */
71
#define         _IFDIR  0040000 /* directory */
72
#define         _IFCHR  0020000 /* character special */
73
#define         _IFBLK  0060000 /* block special */
74
#define         _IFREG  0100000 /* regular */
75
#define         _IFLNK  0120000 /* symbolic link */
76
#define         _IFSOCK 0140000 /* socket */
77
#define         _IFIFO  0010000 /* fifo */
78
 
79
#define S_ISUID         0004000 /* set user id on execution */
80
#define S_ISGID         0002000 /* set group id on execution */
81
#ifndef _POSIX_SOURCE
82
#define S_ISVTX         0001000 /* save swapped text even after use */
83
#define S_IREAD         0000400 /* read permission, owner */
84
#define S_IWRITE        0000200 /* write permission, owner */
85
#define S_IEXEC         0000100 /* execute/search permission, owner */
86
 
87
#define S_ENFMT         0002000 /* enforcement-mode locking */
88
 
89
#define S_IFMT          _IFMT
90
#define S_IFDIR         _IFDIR
91
#define S_IFCHR         _IFCHR
92
#define S_IFBLK         _IFBLK
93
#define S_IFREG         _IFREG
94
#define S_IFLNK         _IFLNK
95
#define S_IFSOCK        _IFSOCK
96
#define S_IFIFO         _IFIFO
97
#endif  /* !_POSIX_SOURCE */
98
 
99
 
100
#define S_IRWXU         0000700 /* rwx, owner */
101
#define         S_IRUSR 0000400 /* read permission, owner */
102
#define         S_IWUSR 0000200 /* write permission, owner */
103
#define         S_IXUSR 0000100 /* execute/search permission, owner */
104
#define S_IRWXG         0000070 /* rwx, group */
105
#define         S_IRGRP 0000040 /* read permission, group */
106
#define         S_IWGRP 0000020 /* write permission, grougroup */
107
#define         S_IXGRP 0000010 /* execute/search permission, group */
108
#define S_IRWXO         0000007 /* rwx, other */
109
#define         S_IROTH 0000004 /* read permission, other */
110
#define         S_IWOTH 0000002 /* write permission, other */
111
#define         S_IXOTH 0000001 /* execute/search permission, other */
112
 
113
#define S_ISBLK(m)      (((m)&_IFMT) == _IFBLK)
114
#define S_ISCHR(m)      (((m)&_IFMT) == _IFCHR)
115
#define S_ISDIR(m)      (((m)&_IFMT) == _IFDIR)
116
#define S_ISFIFO(m)     (((m)&_IFMT) == _IFIFO)
117
#define S_ISREG(m)      (((m)&_IFMT) == _IFREG)
118
#define S_ISLNK(m)      (((m)&_IFMT) == _IFLNK)
119
#define S_ISSOCK(m)     (((m)&_IFMT) == _IFSOCK)
120
 
121
int     _EXFUN(chmod,( const char *_path, mode_t _mode ));
122
int     _EXFUN(fstat,( int _fd, struct stat *_sbuf ));
123
int     _EXFUN(mkdir,( char *_path, mode_t _mode ));
124
int     _EXFUN(mkfifo,( char *_path, mode_t _mode ));
125 56 joel
int     _EXFUN(stat,( const char *_path, struct stat *_sbuf ));
126 39 lampret
mode_t  _EXFUN(umask,( mode_t _mask ));
127
 
128
#ifdef __cplusplus
129
}
130
#endif
131
#endif /* _SYS_STAT_H */

powered by: WebSVN 2.1.0

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