X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Finclude%2Fvfs_ext.h;h=73d82ce58cd4d65643210d48029a123173677a74;hb=86b0974b33759726b99f8940900a88e395247460;hp=65a81624d1df05a5a23ee9609b253cc1edf9f26b;hpb=b7d9f86f7a1c23be18b50d5c647fd5d3c08369c3;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/include/vfs_ext.h b/KernelLand/Kernel/include/vfs_ext.h index 65a81624..73d82ce5 100644 --- a/KernelLand/Kernel/include/vfs_ext.h +++ b/KernelLand/Kernel/include/vfs_ext.h @@ -70,6 +70,10 @@ enum eVFS_SeekDirs * \} */ +#define VFS_ACLENT_ALL 0x7FFFFFFF +#define VFS_GROUP_ANY {1, VFS_ACLENT_ALL} //!< Rules for all users +#define VFS_USER_NOBODY {0, VFS_ACLENT_ALL} //!< Rules for nobody + /** * \brief MMap protection flags * \{ @@ -226,6 +230,20 @@ extern int VFS_DuplicateFD(int SrcFD, int DstFD); */ extern int VFS_SetFDFlags(int FD, int Mask, int Value); +/** + * \brief Save specified file handle such that it can be passed between processes + * \param FD File descriptor to save + * \return Marshalled handle, or (uint64_t)-1 on error + */ +extern Uint64 VFS_MarshalHandle(int FD); + +/** + * \brief Restore a marshalled handle into the current process + * \param Handle returned by VFS_MarshalHandle + * \return File descriptor, or -1 on error + */ +extern int VFS_UnmarshalHandle(Uint64 Handle); + /** * \brief Get file information from an open file * \param FD File handle returned by ::VFS_Open @@ -314,6 +332,16 @@ extern size_t VFS_ReadAt(int FD, Uint64 Offset, size_t Length, void *Buffer); */ extern size_t VFS_WriteAt(int FD, Uint64 Offset, size_t Length, const void *Buffer); +/** + * \brief Set the valid size of a file + * \param FD File descriptor + * \param Size New file size + * \return Actual new file size (-1 if error occurred) + * + * \note Not all files support this call (will return ENOTIMPL) + */ +extern off_t VFS_Truncate(int FD, off_t Size); + /** * \brief Sends an IOCtl request to the driver * \param FD File handle returned by ::VFS_Open