h->Position = Distance;
return 0;
}
+
+/**
+ * \fn int VFS_IOCtl(int FD, int ID, void *Buffer)
+ * \brief Call an IO Control on a file
+ */
+int VFS_IOCtl(int FD, int ID, void *Buffer)
+{
+ tVFS_Handle *h;
+
+ h = VFS_GetHandle(FD);
+ if(!h) return -1;
+
+ if(!h->Node->IOCtl) return -1;
+ return h->Node->IOCtl(h->Node, ID, Buffer);
+}
+
+/**
+ * \fn int VFS_FInfo(int FD, struct s_sysFInfo *Dest, int MaxACLs)
+ * \brief Retrieve file information
+ * \return Number of ACLs stored
+ */
+int VFS_FInfo(int FD, struct s_sysFInfo *Dest, int MaxACLs)
+{
+ tVFS_Handle *h;
+ int max;
+
+ h = VFS_GetHandle(FD);
+ if(!h) return -1;
+
+ Dest->uid = h->Node->UID;
+ Dest->gid = h->Node->GID;
+ Dest->size = h->Node->Size;
+ Dest->atime = h->Node->ATime;
+ Dest->ctime = h->Node->MTime;
+ Dest->mtime = h->Node->CTime;
+ Dest->numacls = h->Node->NumACLs;
+
+ Dest->flags = 0;
+ if(h->Node->Flags & VFS_FFLAG_DIRECTORY) Dest->flags |= 0x10;
+ if(h->Node->Flags & VFS_FFLAG_SYMLINK) Dest->flags |= 0x20;
+
+ max = (MaxACLs < h->Node->NumACLs) ? MaxACLs : h->Node->NumACLs;
+ memcpy(&Dest->acls, h->Node->ACLs, max*sizeof(tVFS_ACL));
+
+ return max;
+}
+
+// === EXPORTS ===
+EXPORT(VFS_Read);
+EXPORT(VFS_Write);
+EXPORT(VFS_ReadAt);
+EXPORT(VFS_WriteAt);
+EXPORT(VFS_IOCtl);
+EXPORT(VFS_Seek);
+EXPORT(VFS_Tell);