+int VFS_SelectNode(tVFS_Node *Node, enum eVFS_SelectTypes Type, tTime *Timeout)
+{
+ tVFS_SelectThread thread_info;
+ tVFS_SelectList **list;
+ int *flag, wanted, maxAllowed;
+
+ ENTER("pNode iType pTimeout", Node, Type, Timeout);
+
+ Semaphore_Init(&thread_info.SleepHandle, 0, 0, "VFS_SelectNode()", "");
+
+ if( VFS_int_Select_GetType(Type, Node, &list, &flag, &wanted, &maxAllowed) ) {
+ LEAVE('i', -1);
+ return -1;
+ }
+
+ VFS_int_Select_AddThread(*list, &thread_info, maxAllowed);
+ if( *flag == wanted )
+ {
+ VFS_int_Select_RemThread(*list, &thread_info);
+ LEAVE('i', 1);
+ return 1;
+ }
+
+ if( !Timeout || *Timeout > 0 )
+ {
+ // TODO: Actual timeout
+ Semaphore_Wait(&thread_info.SleepHandle, 0);
+ }
+
+ VFS_int_Select_RemThread(*list, &thread_info);
+
+ LEAVE('i', *flag == wanted);
+ return *flag == wanted;
+}
+
+int VFS_Select(int MaxHandle, fd_set *ReadHandles, fd_set *WriteHandles, fd_set *ErrHandles, tTime *Timeout, BOOL IsKernel)