psl1ght
A free SDK for Sony's PS3 console
Loading...
Searching...
No Matches
sysfs.h
Go to the documentation of this file.
1#ifndef __LV2_SYSFS_H__
2#define __LV2_SYSFS_H__
4#include <time.h>
5#include <unistd.h>
6#include <ppu-types.h>
8// Open Flags
9#define SYS_O_RDONLY 000000
10#define SYS_O_WRONLY 000001
11#define SYS_O_RDWR 000002
12#define SYS_O_ACCMODE 000003
13#define SYS_O_CREAT 000100
14#define SYS_O_EXCL 000200
15#define SYS_O_TRUNC 001000
16#define SYS_O_APPEND 002000
17#define SYS_O_MSELF 010000
18
19#define SYS_FS_IO_BUFFER_PAGE_SIZE_64KB 2
20#define SYS_FS_IO_BUFFER_PAGE_SIZE_1MB 4
21
22#ifdef __cplusplus
23 extern "C" {
24#endif
25
26typedef struct _sys_fs_stat
27{
29 s32 st_uid;
30 s32 st_gid;
31 time_t st_atime;
32 time_t st_mtime;
33 time_t st_ctime;
36} __attribute__((packed)) sysFSStat;
37
38typedef struct _sys_fs_dirent
39{
42 char d_name[MAXPATHLEN + 1];
44
50
51typedef struct _sys_fs_utime
52{
53 time_t actime;
54 time_t modtime;
56
57typedef struct _sys_fs_aio
58{
59 s32 fd;
60 u64 offset;
62 u64 size;
65
66typedef void (*sysFsAioCallback)(sysFSAio *aio,s32 error,s32 xid,u64 size);
67
68s32 sysFsOpen(const char *path,s32 oflags,s32 *fd,const void *arg,u64 argsize);
69s32 sysFsClose(s32 fd);
70s32 sysFsRead(s32 fd,void *ptr,u64 len,u64 *read);
71s32 sysFsWrite(s32 fd, const void* ptr, u64 size, u64* written);
72s32 sysFsLseek(s32 fd, s64 offset, s32 whence, u64* position);
73s32 sysFsStat(const char* path, sysFSStat* stat);
74s32 sysFsFstat(s32 fd, sysFSStat* stat);
75s32 sysFsChmod(const char* path, s32 mode);
76s32 sysFsMkdir(const char* path, s32 mode);
77s32 sysFsRmdir(const char *path);
78s32 sysFsUnlink(const char *path);
79s32 sysFsAccess(const char *path,s32 amode);
80s32 sysFsUtime(const char *path, sysFSUtimbuf *times);
81
82s32 sysFsOpendir(const char *path, s32 *fd);
83s32 sysFsClosedir(s32 fd);
84s32 sysFsReaddir(s32 fd, sysFSDirent* entry, u64* read);
85
86s32 sysFsAioInit(const char * path);
87s32 sysFsAioFinish(const char * path);
88s32 sysFsAioCancel(s32 id);
89
90s32 sysFsAioRead(sysFSAio *aio, s32 *id, sysFsAioCallback cb);
92
93s32 sysFsGetFreeSize(const char *path, u32 *blockSize, u64 *freeBlocks);
94s32 sysFsGetDirectoryEntries(s32 fd, sysFSDirectoryEntry *entries, u32 entrySize, u32 *dataCount);
95
96s32 sysFsSetIoBuffer(s32 fd, size_t bufferSizeLimit, s32 pageType, sys_mem_container_t container);
97s32 sysFsSetDefaultContainer(sys_mem_container_t container, size_t totalLimit);
98s32 sysFsSetIoBufferFromDefaultContainer(s32 fd, size_t bufferSizeLimit, s32 pageType);
99
100#ifdef __cplusplus
101 }
102#endif
103
104#endif
struct _heap_cntrl_t __attribute__
uintptr_t size
Definition heap.h:1
u64 offset
Definition sysfs.h:60
u32 buffer_addr
Definition sysfs.h:61
u64 size
Definition sysfs.h:62
s32 fd
Definition sysfs.h:59
u64 usrdata
Definition sysfs.h:63
Definition sysfs.h:46
sysFSStat attribute
Definition sysfs.h:47
sysFSDirent entry_name
Definition sysfs.h:48
char d_name[MAXPATHLEN+1]
Definition sysfs.h:42
time_t st_ctime
Definition sysfs.h:33
time_t st_mtime
Definition sysfs.h:32
u64 st_blksize
Definition sysfs.h:35
s32 st_mode
Definition sysfs.h:28
s32 st_uid
Definition sysfs.h:29
time_t st_atime
Definition sysfs.h:31
u64 st_size
Definition sysfs.h:34
s32 st_gid
Definition sysfs.h:30
time_t actime
Definition sysfs.h:53
time_t modtime
Definition sysfs.h:54
s32 sysFsAccess(const char *path, s32 amode)
struct _sys_fs_utime sysFSUtimbuf
s32 sysFsGetFreeSize(const char *path, u32 *blockSize, u64 *freeBlocks)
s32 sysFsLseek(s32 fd, s64 offset, s32 whence, u64 *position)
s32 sysFsUtime(const char *path, sysFSUtimbuf *times)
struct _sys_fs_aio sysFSAio
struct _sys_fs_dirent sysFSDirent
s32 sysFsRmdir(const char *path)
s32 sysFsReaddir(s32 fd, sysFSDirent *entry, u64 *read)
s32 sysFsChmod(const char *path, s32 mode)
s32 sysFsSetDefaultContainer(sys_mem_container_t container, size_t totalLimit)
s32 sysFsAioWrite(sysFSAio *aio, s32 *id, sysFsAioCallback cb)
s32 sysFsClosedir(s32 fd)
s32 sysFsStat(const char *path, sysFSStat *stat)
s32 sysFsUnlink(const char *path)
s32 sysFsAioFinish(const char *path)
s32 sysFsClose(s32 fd)
s32 sysFsFstat(s32 fd, sysFSStat *stat)
s32 sysFsAioRead(sysFSAio *aio, s32 *id, sysFsAioCallback cb)
s32 sysFsGetDirectoryEntries(s32 fd, sysFSDirectoryEntry *entries, u32 entrySize, u32 *dataCount)
s32 sysFsOpen(const char *path, s32 oflags, s32 *fd, const void *arg, u64 argsize)
s32 sysFsRead(s32 fd, void *ptr, u64 len, u64 *read)
s32 sysFsMkdir(const char *path, s32 mode)
s32 sysFsSetIoBuffer(s32 fd, size_t bufferSizeLimit, s32 pageType, sys_mem_container_t container)
s32 sysFsOpendir(const char *path, s32 *fd)
void(* sysFsAioCallback)(sysFSAio *aio, s32 error, s32 xid, u64 size)
Definition sysfs.h:66
s32 sysFsSetIoBufferFromDefaultContainer(s32 fd, size_t bufferSizeLimit, s32 pageType)
s32 sysFsWrite(s32 fd, const void *ptr, u64 size, u64 *written)
s32 sysFsAioCancel(s32 id)
struct _sys_fs_directory_entry sysFSDirectoryEntry
s32 sysFsAioInit(const char *path)