8 #define MAX_KERNEL_FILES 32
11 tVFS_Handle gaKernelHandles[MAX_KERNEL_FILES];
14 int VFS_AllocHandle(int bIsUser, tVFS_Node *Node, int Mode)
16 for( int i = 0; i < MAX_KERNEL_FILES; i ++ )
18 if(gaKernelHandles[i].Node) continue;
19 gaKernelHandles[i].Node = Node;
20 gaKernelHandles[i].Position = 0;
21 gaKernelHandles[i].Mode = Mode;
28 tVFS_Handle *VFS_GetHandle(int ID)
30 if( ID < 0 || ID >= MAX_KERNEL_FILES )
32 return &gaKernelHandles[ID];
35 int VFS_SetHandle(int FD, tVFS_Node *Node, int Mode)
37 if( FD < 0 || FD >= MAX_KERNEL_FILES )
39 gaKernelHandles[FD].Node = Node;
40 gaKernelHandles[FD].Mode = Mode;