12 #include "darkplaces.h"
16 // =======================================================================
18 // =======================================================================
19 void Sys_Shutdown (void)
22 fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NONBLOCK);
27 void Sys_Error (const char *error, ...)
30 char string[MAX_INPUTLINE];
32 // change stdin to non blocking
34 fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NONBLOCK);
36 va_start (argptr,error);
37 dpvsnprintf (string, sizeof (string), error, argptr);
40 Con_Printf(CON_ERROR "Engine Error: %s\n", string);
46 void Sys_Print(const char *text)
50 // BUG: for some reason, NDELAY also affects stdout (1) when used on stdin (0).
51 // this is because both go to /dev/tty by default!
54 int origflags = fcntl (sys.outfd, F_GETFL, 0);
55 fcntl (sys.outfd, F_SETFL, origflags & ~O_NONBLOCK);
61 fs_offset_t written = (fs_offset_t)write(sys.outfd, text, (int)strlen(text));
63 break; // sorry, I cannot do anything about this error - without an output
67 fcntl (sys.outfd, F_SETFL, origflags);
70 //fprintf(stdout, "%s", text);
73 char *Sys_GetClipboardData (void)
78 void Sys_SDL_Init(void)
82 qbool sys_supportsdlgetticks = false;
83 unsigned int Sys_SDL_GetTicks (void)
85 Sys_Error("Called Sys_SDL_GetTicks on non-SDL target");
88 void Sys_SDL_Delay (unsigned int milliseconds)
90 Sys_Error("Called Sys_SDL_Delay on non-SDL target");