+//! Architectual maximum number of file descriptors
+#define MAX_FILE_DESCS 128
+
+/**
+ * \brief VFS_Seek directions
+ */
+enum eVFS_SeekDirs
+{
+ SEEK_SET = 1, //!< Set the current file offset
+ SEEK_CUR = 0, //!< Seek relative to the current position
+ SEEK_END = -1 //!< Seek from the end of the file backwards
+};
+
+/**
+ * \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
+/**
+ * \}
+ */
+
+/**
+ * \brief MMap protection flags
+ * \{
+ */
+#define MMAP_PROT_READ 0x001 //!< Readable memory
+#define MMAP_PROT_WRITE 0x002 //!< Writable memory
+#define MMAP_PROT_EXEC 0x004 //!< Executable memory
+/**
+ * \}
+ */
+
+/**
+ * \brief MMap mapping flags
+ * \{
+ */
+#define MMAP_MAP_SHARED 0x001 //!< Shared with all other users of the FD
+#define MMAP_MAP_PRIVATE 0x002 //!< Local (COW) copy
+#define MMAP_MAP_FIXED 0x004 //!< Load to a fixed address
+#define MMAP_MAP_ANONYMOUS 0x008 //!< Not associated with a FD
+/**
+ * \}
+ */
+
+// -- System Call Structures ---
+/**
+ * \brief ACL Defintion Structure
+ */
+typedef struct sVFS_ACL
+{
+ struct {
+ unsigned Group: 1; //!< Group (as opposed to user) flag
+ unsigned ID: 31; //!< ID of Group/User (-1 for nobody/world)
+ };
+ struct {
+ unsigned Inv: 1; //!< Invert Permissions
+ unsigned Perms: 31; //!< Permission Flags
+ };
+} tVFS_ACL;
+
+/**
+ * \brief SYS_FINFO structure
+ */
+typedef struct sFInfo
+{
+ tMount mount; //!< Mountpoint ID
+ tInode inode; //!< Inode
+ Uint32 uid; //!< Owning User ID
+ Uint32 gid; //!< Owning Group ID
+ Uint32 flags; //!< File flags
+ Uint64 size; //!< File Size
+ Sint64 atime; //!< Last Accessed time
+ Sint64 mtime; //!< Last modified time
+ Sint64 ctime; //!< Creation time
+ Sint32 numacls; //!< Total number of ACL entries
+ tVFS_ACL acls[]; //!< ACL buffer (size is passed in the \a MaxACLs argument to VFS_FInfo)
+} PACKED tFInfo;
+
+/**
+ * \brief fd_set for select()
+ */
+typedef struct
+{
+ //! Bitmap of set file descriptors
+ Uint16 flags[MAX_FILE_DESCS/16];
+} fd_set;
+
+/**
+ * \brief Clear a descriptor flag in a fd_set
+ * \param fd File descriptor to clear
+ * \param fdsetp Set to modify
+ */
+#define FD_CLR(fd, fdsetp) ((fdsetp)->flags[(fd)/16]&=~(1<<((fd)%16)))
+/**
+ * \brief Set a descriptor flag in a fd_set
+ * \param fd File descriptor to set
+ * \param fdsetp Set to modify
+ */
+#define FD_SET(fd, fdsetp) ((fdsetp)->flags[(fd)/16]|=~(1<<((fd)%16)))
+/**
+ * \brief Test a descriptor flag in a fd_set
+ * \param fd File descriptor to test
+ * \param fdsetp Set to modify
+ */
+#define FD_ISSET(fd, fdsetp) ((fdsetp)->flags[(fd)/16]&(1<<((fd)%16)))