X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Finclude%2Fvfs_ext.h;h=00eeebb5fef0bf152ceddc291d12297e700ae8ba;hb=3f9b3f4cb91ce4ada9c892e6f2a3c69dbb9debd6;hp=44c70f869dd58bcca9a5aad5a9f1a75b18c4443c;hpb=4ebe00546574e97c5316881881f7f2562deea74b;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/include/vfs_ext.h b/KernelLand/Kernel/include/vfs_ext.h index 44c70f86..00eeebb5 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) @@ -31,7 +32,7 @@ typedef Uint32 tMount; //! Create the file if it doesn't exist #define VFS_OPENFLAG_CREATE 0x80 //! Treat as a directory -#define VFS_OPENFLAG_DIRECTORY 0x100 +#define VFS_OPENFLAG_DIRECTORY 0x1000 //! Open as a user #define VFS_OPENFLAG_USER 0x8000 /** @@ -115,14 +116,16 @@ 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 - }; + } Perm; } tVFS_ACL; /** @@ -143,6 +146,10 @@ typedef struct sFInfo tVFS_ACL acls[]; //!< ACL buffer (size is passed in the \a MaxACLs argument to VFS_FInfo) } PACKED tFInfo; +// --- fd_set -- +#include "../../../Usermode/Libraries/ld-acess.so_src/include_exp/acess/fd_set.h" + +#if 0 /** * \brief fd_set for select() */ @@ -170,6 +177,7 @@ typedef struct * \param fdsetp Set to modify */ #define FD_ISSET(fd, fdsetp) ((fdsetp)->flags[(fd)/16]&(1<<((fd)%16))) +#endif // === FUNCTIONS === /** @@ -218,6 +226,18 @@ extern int VFS_OpenInode(Uint32 Mount, Uint64 Inode, int Mode); */ 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