misc - Cleaning up warnings that occur on travis
[tpg/acess2.git] / KernelLand / Kernel / include / vfs_ext.h
index d18009d..73d82ce 100644 (file)
@@ -60,35 +60,20 @@ 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)
 /**
  * \}
  */
 
+#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
  * \{
@@ -245,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
@@ -333,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

UCC git Repository :: git.ucc.asn.au