X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Finclude%2Fvfs_ext.h;h=65a81624d1df05a5a23ee9609b253cc1edf9f26b;hb=fabb7ed39828c58b044f9c2b4f27f55b96c6d56a;hp=1bae964f6879c31ef0e8f21bc292fa2a9ec52741;hpb=fe07801ccb8de442c9fc665cd1706faa0f12c166;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/include/vfs_ext.h b/KernelLand/Kernel/include/vfs_ext.h index 1bae964f..65a81624 100644 --- a/KernelLand/Kernel/include/vfs_ext.h +++ b/KernelLand/Kernel/include/vfs_ext.h @@ -22,17 +22,19 @@ typedef Uint32 tMount; * \{ */ //! Open for execution -#define VFS_OPENFLAG_EXEC 0x01 +#define VFS_OPENFLAG_EXEC 0x001 //! Open for reading -#define VFS_OPENFLAG_READ 0x02 +#define VFS_OPENFLAG_READ 0x002 //! Open for writing -#define VFS_OPENFLAG_WRITE 0x04 +#define VFS_OPENFLAG_WRITE 0x004 //! Do not resolve the final symbolic link -#define VFS_OPENFLAG_NOLINK 0x40 +#define VFS_OPENFLAG_NOLINK 0x040 //! Create the file if it doesn't exist -#define VFS_OPENFLAG_CREATE 0x80 +#define VFS_OPENFLAG_CREATE 0x080 +//! Open file as non-blocking +#define VFS_OPENFLAG_NONBLOCK 0x100 //! Treat as a directory -#define VFS_OPENFLAG_DIRECTORY 0x100 +#define VFS_OPENFLAG_DIRECTORY 0x1000 //! Open as a user #define VFS_OPENFLAG_USER 0x8000 /** @@ -58,31 +60,12 @@ enum eVFS_SeekDirs * \name ACL Permissions * \{ */ -/** - * \brief Readable - */ -#define VFS_PERM_READ 0x00000001 -/** - * \brief Writeable - */ -#define VFS_PERM_WRITE 0x00000002 -/** - * \brief Append allowed - */ -#define VFS_PERM_APPEND 0x00000004 -/** - * \brief Executable - */ -#define VFS_PERM_EXECUTE 0x00000008 -/** - * \brief All permissions granted - */ -#define VFS_PERM_ALL 0x7FFFFFFF // Mask for permissions -/** - * \brief Denies instead of granting permissions - * \note Denials take precedence - */ -#define VFS_PERM_DENY 0x80000000 // Inverts permissions +#define VFS_PERM_READ 0x00000001 //!< Readable +#define VFS_PERM_WRITE 0x00000002 //!< Writable +#define VFS_PERM_APPEND 0x00000004 //!< Appendable (/create file) +#define VFS_PERM_EXEC 0x00000008 //!< Executable (/Traversable) +#define VFS_PERM_ALL 0x7FFFFFFF //!< All permission bits +#define VFS_PERM_DENY 0x80000000 //!< Flag for denying a permission set (higher precedence) /** * \} */ @@ -220,6 +203,11 @@ extern int VFS_OpenChild(int FD, const char *Name, Uint Mode); */ extern int VFS_OpenInode(Uint32 Mount, Uint64 Inode, int Mode); +/** + * \brief Open a file reusing an old FD + */ +extern int VFS_Reopen(int FD, const char *Path, int Flags); + /** * \brief Close a currently open file * \param FD Handle returned by ::VFS_Open @@ -233,6 +221,11 @@ extern void VFS_Close(int FD); */ extern int VFS_DuplicateFD(int SrcFD, int DstFD); +/** + * \brief Update the flags on a FD + */ +extern int VFS_SetFDFlags(int FD, int Mask, int Value); + /** * \brief Get file information from an open file * \param FD File handle returned by ::VFS_Open