X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fvfs%2Fopen.c;h=067a73acf64bc17bfe233071c6b66264d3771457;hb=3f9b3f4cb91ce4ada9c892e6f2a3c69dbb9debd6;hp=67ef58a6cbf4b013db9ed86e9c2065e3f4251648;hpb=b60e6b273c3ecb1614d937bf9448033e9d339e83;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/vfs/open.c b/KernelLand/Kernel/vfs/open.c index 67ef58a6..067a73ac 100644 --- a/KernelLand/Kernel/vfs/open.c +++ b/KernelLand/Kernel/vfs/open.c @@ -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 */