(#4925) - com_pipefile to create a named pipe for sending commands from other processes, patch by Chris Schwarz

This commit is contained in:
Thilo Schulz 2011-03-10 01:01:27 +00:00
parent a3def2744f
commit 3bf8ec2dab
6 changed files with 122 additions and 0 deletions

View file

@ -247,6 +247,31 @@ qboolean Sys_Mkdir( const char *path )
return qtrue;
}
/*
==================
Sys_Mkfifo
==================
*/
FILE *Sys_Mkfifo( const char *ospath )
{
FILE *fifo;
int result;
int fn;
result = mkfifo( ospath, 0600 );
if( result != 0 )
return NULL;
fifo = fopen( ospath, "w+" );
if( fifo )
{
fn = fileno( fifo );
fcntl( fn, F_SETFL, O_NONBLOCK );
}
return fifo;
}
/*
==================
Sys_Cwd