sdk-core
v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Toggle main menu visibility
Loading...
Searching...
No Matches
iox_stat.h
Go to the documentation of this file.
1
/*
2
# _____ ___ ____ ___ ____
3
# ____| | ____| | | |____|
4
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5
#-----------------------------------------------------------------------
6
# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org>
7
# Licenced under Academic Free License version 2.0
8
# Review ps2sdk README & LICENSE files for further details.
9
*/
10
16
17
#ifndef __SYS_IOX_STAT_H__
18
#define __SYS_IOX_STAT_H__
19
20
#include <
sys/time.h
>
21
22
#ifdef _EE
23
#ifndef NEWLIB_PORT_AWARE
24
#error "Using fio/fileXio functions directly in the newlib port will lead to problems."
25
#error "Use posix function calls instead."
26
#endif
27
#endif
28
29
// Flags for chstat 'statmask'
30
#define FIO_CST_MODE 0x0001
31
#define FIO_CST_ATTR 0x0002
32
#define FIO_CST_SIZE 0x0004
33
#define FIO_CST_CT 0x0008
34
#define FIO_CST_AT 0x0010
35
#define FIO_CST_MT 0x0020
36
#define FIO_CST_PRVT 0x0040
37
38
// File mode flags
40
#define FIO_S_IFMT 0xF000
42
#define FIO_S_IFLNK 0x4000
44
#define FIO_S_IFREG 0x2000
46
#define FIO_S_IFDIR 0x1000
47
48
// Access rights
50
#define FIO_S_ISUID 0x0800
52
#define FIO_S_ISGID 0x0400
54
#define FIO_S_ISVTX 0x0200
55
57
#define FIO_S_IRWXU 0x01C0
59
#define FIO_S_IRUSR 0x0100
61
#define FIO_S_IWUSR 0x0080
63
#define FIO_S_IXUSR 0x0040
64
66
#define FIO_S_IRWXG 0x0038
68
#define FIO_S_IRGRP 0x0020
70
#define FIO_S_IWGRP 0x0010
72
#define FIO_S_IXGRP 0x0008
73
75
#define FIO_S_IRWXO 0x0007
77
#define FIO_S_IROTH 0x0004
79
#define FIO_S_IWOTH 0x0002
81
#define FIO_S_IXOTH 0x0001
82
83
// File mode checking macros
84
#define FIO_S_ISLNK(m) (((m)&FIO_S_IFMT) == FIO_S_IFLNK)
85
#define FIO_S_ISREG(m) (((m)&FIO_S_IFMT) == FIO_S_IFREG)
86
#define FIO_S_ISDIR(m) (((m)&FIO_S_IFMT) == FIO_S_IFDIR)
87
88
/* File attributes that are retrieved using the getstat and dread calls, and
89
set using chstat. */
90
91
/* The following structures are only supported by iomanX. */
92
93
typedef
struct
94
{
95
unsigned
int
mode;
96
unsigned
int
attr;
97
unsigned
int
size;
98
unsigned
char
ctime[8];
99
unsigned
char
atime[8];
100
unsigned
char
mtime[8];
101
unsigned
int
hisize;
103
unsigned
int
private_0
;
104
unsigned
int
private_1;
105
unsigned
int
private_2;
106
unsigned
int
private_3;
107
unsigned
int
private_4;
109
unsigned
int
private_5
;
110
}
iox_stat_t
__attribute__
((aligned(64)));
111
112
typedef
struct
113
{
114
iox_stat_t
stat;
115
char
name[256];
116
void
*privdata;
117
}
iox_dirent_t
__attribute__
((aligned(64)));
118
119
/* The following defines are only supported by ioman. */
120
121
// File mode flags (for mode in io_stat_t)
123
#define FIO_SO_IFMT 0x0038
125
#define FIO_SO_IFLNK 0x0008
127
#define FIO_SO_IFREG 0x0010
129
#define FIO_SO_IFDIR 0x0020
130
132
#define FIO_SO_IROTH 0x0004
134
#define FIO_SO_IWOTH 0x0002
136
#define FIO_SO_IXOTH 0x0001
137
138
// File mode checking macros
139
#define FIO_SO_ISLNK(m) (((m)&FIO_SO_IFMT) == FIO_SO_IFLNK)
140
#define FIO_SO_ISREG(m) (((m)&FIO_SO_IFMT) == FIO_SO_IFREG)
141
#define FIO_SO_ISDIR(m) (((m)&FIO_SO_IFMT) == FIO_SO_IFDIR)
142
143
#endif
/* __SYS_IOX_STAT_H__ */
__attribute__
Definition
gif_registers.h:40
iox_dirent_t
Definition
iox_stat.h:113
iox_stat_t
Definition
iox_stat.h:94
iox_stat_t::private_0
unsigned int private_0
Definition
iox_stat.h:103
iox_stat_t::private_5
unsigned int private_5
Definition
iox_stat.h:109
time.h
core
common
include
iox_stat.h
Generated by
1.18.0