X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fvfs%2Fio.c;h=f2d47ce18f68e551aebf2d6cffe982443b693cd7;hb=de2ae10743172075f2d527780bdfd890ccddb8e7;hp=b27e7f090b1e71e5bea3a1b8a0ab1beaa1ca2fa1;hpb=04b368645c34cc3853fc13f93e33ac7878be8479;p=tpg%2Facess2.git diff --git a/Kernel/vfs/io.c b/Kernel/vfs/io.c index b27e7f09..f2d47ce1 100644 --- a/Kernel/vfs/io.c +++ b/Kernel/vfs/io.c @@ -2,7 +2,7 @@ * AcessMicro VFS * - File IO Passthru's */ -#include +#include #include "vfs.h" #include "vfs_int.h" @@ -103,7 +103,7 @@ Uint64 VFS_Write(int FD, Uint64 Length, void *Buffer) /** * \fn Uint64 VFS_WriteAt(int FD, Uint64 Offset, Uint64 Length, void *Buffer) - * \brief Write data to a file at a given offset (atomic) + * \brief Write data to a file at a given offset */ Uint64 VFS_WriteAt(int FD, Uint64 Offset, Uint64 Length, void *Buffer) { @@ -137,33 +137,36 @@ Uint64 VFS_Tell(int FD) } /** - * \fn int VFS_Seek(int FD, Sint64 Distance, int Whence) + * \fn int VFS_Seek(int FD, Sint64 Offset, int Whence) * \brief Seek to a new location * \param FD File descriptor - * \param Distance Where to go + * \param Offset Where to go * \param Whence From where */ -int VFS_Seek(int FD, Sint64 Distance, int Whence) +int VFS_Seek(int FD, Sint64 Offset, int Whence) { tVFS_Handle *h; h = VFS_GetHandle(FD); if(!h) return -1; + //Log_Debug("VFS", "VFS_Seek: (fd=0x%x, Offset=0x%llx, Whence=%i)", + // FD, Offset, Whence); + // Set relative to current position if(Whence == 0) { - h->Position += Distance; + h->Position += Offset; return 0; } // Set relative to end of file if(Whence < 0) { - h->Position = h->Node->Size - Distance; + h->Position = h->Node->Size - Offset; return 0; } // Set relative to start of file - h->Position = Distance; + h->Position = Offset; return 0; } @@ -183,11 +186,11 @@ int VFS_IOCtl(int FD, int ID, void *Buffer) } /** - * \fn int VFS_FInfo(int FD, struct s_sysFInfo *Dest, int MaxACLs) + * \fn int VFS_FInfo(int FD, tFInfo *Dest, int MaxACLs) * \brief Retrieve file information * \return Number of ACLs stored */ -int VFS_FInfo(int FD, struct s_sysFInfo *Dest, int MaxACLs) +int VFS_FInfo(int FD, tFInfo *Dest, int MaxACLs) { tVFS_Handle *h; int max; @@ -212,3 +215,12 @@ int VFS_FInfo(int FD, struct s_sysFInfo *Dest, int MaxACLs) return max; } + +// === EXPORTS === +EXPORT(VFS_Read); +EXPORT(VFS_Write); +EXPORT(VFS_ReadAt); +EXPORT(VFS_WriteAt); +EXPORT(VFS_IOCtl); +EXPORT(VFS_Seek); +EXPORT(VFS_Tell);