1 #ifndef __LV2_SYSFS_H__ 2 #define __LV2_SYSFS_H__ 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 19 #define SYS_FS_IO_BUFFER_PAGE_SIZE_64KB 2 20 #define SYS_FS_IO_BUFFER_PAGE_SIZE_1MB 4 36 } __attribute__((packed)) sysFSStat;
42 char d_name[MAXPATHLEN + 1];
60 typedef void (*sysFsAioCallback)(
sysFSAio *aio,s32 error,s32 xid,u64 size);
62 s32 sysFsOpen(
const char *path,s32 oflags,s32 *fd,
const void *arg,u64 argsize);
63 s32 sysFsClose(s32 fd);
64 s32 sysFsRead(s32 fd,
void *ptr,u64 len,u64 *read);
65 s32 sysFsWrite(s32 fd,
const void* ptr, u64 size, u64* written);
66 s32 sysFsLseek(s32 fd, s64 offset, s32 whence, u64* position);
67 s32 sysFsStat(
const char* path, sysFSStat* stat);
68 s32 sysFsFstat(s32 fd, sysFSStat* stat);
69 s32 sysFsChmod(
const char* path, s32 mode);
70 s32 sysFsMkdir(
const char* path, s32 mode);
71 s32 sysFsRmdir(
const char *path);
72 s32 sysFsUnlink(
const char *path);
74 s32 sysFsOpendir(
const char *path, s32 *fd);
75 s32 sysFsClosedir(s32 fd);
76 s32 sysFsReaddir(s32 fd,
sysFSDirent* entry, u64* read);
78 s32 sysFsAioInit(
const char * path);
79 s32 sysFsAioFinish(
const char * path);
80 s32 sysFsAioCancel(s32
id);
82 s32 sysFsAioRead(
sysFSAio *aio, s32 *
id, sysFsAioCallback cb);
83 s32 sysFsAioWrite(
sysFSAio *aio, s32 *
id, sysFsAioCallback cb);
85 s32 sysFsGetFreeSize(
const char *path, u32 *blockSize, u64 *freeBlocks);
87 s32 sysFsSetIoBuffer(s32 fd,
size_t bufferSizeLimit, s32 pageType, sys_mem_container_t container);
88 s32 sysFsSetDefaultContainer(sys_mem_container_t container,
size_t totalLimit);
89 s32 sysFsSetIoBufferFromDefaultContainer(s32 fd,
size_t bufferSizeLimit, s32 pageType);