-SYSCALL2(Syscall_Open, VFS_Open, "di", const char *, int);
-SYSCALL1V(Syscall_Close, VFS_Close, "i", int);
-SYSCALL3(Syscall_Read, VFS_Read, "iid", int, int, void *);
-SYSCALL3(Syscall_Write, VFS_Write, "iid", int, int, const void *);
+SYSCALL2(Syscall_Open, "si", const char *, int,
+ return VFS_Open(a0, a1|VFS_OPENFLAG_USER);
+);
+SYSCALL1(Syscall_Close, "i", int,
+ VFS_Close(a0);
+ return 0;
+);
+SYSCALL3(Syscall_Read, "iid", int, int, void *,
+ if( Sizes[2] <= a1 )
+ return -1;
+ return VFS_Read(a0, a1, a2);
+);
+SYSCALL3(Syscall_Write, "iid", int, int, const void *,
+ if( Sizes[2] <= a1 )
+ return -1;
+ return VFS_Write(a0, a1, a2);
+);
+SYSCALL3(Syscall_Seek, "iIi", int, int64_t, int,
+ return VFS_Seek(a0, a1, a2);
+);
+SYSCALL1(Syscall_Tell, "i", int,
+ return VFS_Tell(a0);
+);
+SYSCALL3(Syscall_IOCtl, "iid", int, int, void *,
+ return VFS_IOCtl(a0, a1, a2);
+);
+SYSCALL3(Syscall_FInfo, "idi", int, void *, int,
+ if( Sizes[1] < sizeof(tFInfo)+a2*sizeof(tVFS_ACL))
+ return -1;
+ return VFS_FInfo(a0, a1, a2);
+);