+ if(pipe->Flags & PF_BLOCKING) {
+ if( pipe->ReadPos == (pipe->WritePos+1)%pipe->BufSize )
+ VFS_SelectNode(Node, VFS_SELECT_WRITE, NULL, "FIFO_Write");
+
+ len = remaining;
+ if( pipe->ReadPos > pipe->WritePos )
+ {
+ int rem_space = pipe->ReadPos - pipe->WritePos;
+ if(rem_space < remaining) len = rem_space;
+ }
+ else
+ {
+ int rem_space = pipe->ReadPos + pipe->BufSize - pipe->WritePos;
+ if(rem_space < remaining) len = rem_space;
+ }
+ }