X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Finclude%2Fvfs_ext.h;h=d18009d4db9218f669fba655f8ec4711d7c8a5da;hb=c34752b7ccc945a70a2d9b1e505aa4a4de43163b;hp=1bc3e18a93d35a408a9be4c0f06b65deb997eccb;hpb=7ba570fe3cc5418f42decf5b72ac2295cce9e60f;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/include/vfs_ext.h b/KernelLand/Kernel/include/vfs_ext.h index 1bc3e18a..d18009d4 100644 --- a/KernelLand/Kernel/include/vfs_ext.h +++ b/KernelLand/Kernel/include/vfs_ext.h @@ -13,6 +13,7 @@ typedef Uint64 tInode; typedef Uint32 tMount; // === CONSTANTS === +//! Maximum length of a filename (including NULL byte) #define FILENAME_MAX 256 //! Maximum size of a Memory Path generated by VFS_GetMemPath #define VFS_MEMPATH_SIZE (3 + (BITS/4)*2) @@ -21,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 /** @@ -115,10 +118,12 @@ enum eVFS_SeekDirs */ typedef struct sVFS_ACL { + //! ACL entity selection struct { unsigned Group: 1; //!< Group (as opposed to user) flag unsigned ID: 31; //!< ID of Group/User (-1 for nobody/world) } Ent; + //! ACL Permissions mask struct { unsigned Inv: 1; //!< Invert Permissions unsigned Perms: 31; //!< Permission Flags @@ -217,12 +222,29 @@ 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 */ extern void VFS_Close(int FD); +/** + * \brief Copy one FD to another + * \param SrcFD Source file descriptor + * \param DstFD Destination file descriptor (-1 means allocate new) + */ +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