X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=AcessNative%2Fld-acess_src%2Fexports.c;h=c236b526a5c57a951a1eb5bf3807fa3a86db6791;hb=2da16f7b05b8c3f17ac136128a849db332b067ad;hp=0c87bda674ef882eae453f55e7928a90d797fd8a;hpb=a41f3e5efdf853726d078dc03550de40e9d63bdd;p=tpg%2Facess2.git diff --git a/AcessNative/ld-acess_src/exports.c b/AcessNative/ld-acess_src/exports.c index 0c87bda6..c236b526 100644 --- a/AcessNative/ld-acess_src/exports.c +++ b/AcessNative/ld-acess_src/exports.c @@ -12,6 +12,7 @@ #include #define DEBUG(v...) Debug(v) +#define PAGE_SIZE 4096 typedef struct sFILE FILE; @@ -93,9 +94,14 @@ uint64_t acess_tell(int FD) { } int acess_ioctl(int fd, int id, void *data) { + int len; // NOTE: 1024 byte size is a hack DEBUG("ioctl(%i, %i, %p)", fd, id, data); - return _Syscall(SYS_IOCTL, ">i >i ?d", fd, id, 1024, data); + if( data == NULL ) + len = 0; + else + len = PAGE_SIZE - ((uintptr_t)data % PAGE_SIZE); + return _Syscall(SYS_IOCTL, ">i >i ?d", fd, id, len, data); } int acess_finfo(int fd, t_sysFInfo *info, int maxacls) { // DEBUG("offsetof(size, t_sysFInfo) = %i", offsetof(t_sysFInfo, size));