Kernel - SYS_FDCTL
[tpg/acess2.git] / KernelLand / Kernel / vfs / open.c
index 67ef58a..067a73a 100644 (file)
@@ -23,7 +23,7 @@ extern tVFS_Node      *VFS_MemFile_Create(const char *Path);
 // === PROTOTYPES ===
 void   _ReferenceMount(tVFS_Mount *Mount, const char *DebugTag);
 void   _DereferenceMount(tVFS_Mount *Mount, const char *DebugTag);
- int   VFS_int_CreateHandle( tVFS_Node *Node, tVFS_Mount *Mount, int Mode );
+ int   VFS_int_CreateHandle(tVFS_Node *Node, tVFS_Mount *Mount, int Mode);
 
 // === CODE ===
 void _ReferenceMount(tVFS_Mount *Mount, const char *DebugTag)
@@ -769,6 +769,21 @@ int VFS_DuplicateFD(int SrcFD, int DstFD)
        return DstFD;
 }
 
+/*
+ * Update flags on a FD
+ */
+int VFS_SetFDFlags(int FD, int Mask, int Value)
+{
+       tVFS_Handle     *h = VFS_GetHandle(FD);
+       if(!FD) return -1;
+        int    ret = h->Mode;
+       
+       Value &= Mask;
+       h->Mode &= ~Mask;
+       h->Mode |= Value;
+       return ret;
+}
+
 /**
  * \brief Change current working directory
  */

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