--- ray/src/common/win_process.c 2003/06/26 00:58:09 3.1 +++ ray/src/common/win_process.c 2003/10/21 19:19:28 3.4 @@ -1,5 +1,5 @@ #ifndef lint -static char RCSid[]="$Id: win_process.c,v 3.1 2003/06/26 00:58:09 schorsch Exp $"; +static char RCSid[]="$Id: win_process.c,v 3.4 2003/10/21 19:19:28 schorsch Exp $"; #endif /* * Routines to communicate with separate process via dual pipes. @@ -16,13 +16,21 @@ static char RCSid[]="$Id: win_process.c,v 3.1 2003/06/ #include /* _open_osfhandle */ #include /* _O_XXX */ -#include "standard.h" +#include "rterror.h" +#include "rtio.h" #include "rtprocess.h" -/* Looks like some Windows versions use negative PIDs. - Let's just hope they either make them *all* negative, or none. */ -static int system_uses_negative_pids = 0; +int +win_nice(int inc) /* simple nice(2) replacement for Windows */ +{ + /* We don't have much granularity available: IDLE_PRIORITY_CLASS + will run whenever no other higher priority process is running */ + if (inc > 0) { + return (int)!SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS); + } + return 0; +} /* @@ -270,7 +278,6 @@ open_process(SUBPROC *proc, char *av[]) { char *cmdpath; char *cmdstr; - int res; proc->running = 0; cmdpath = getpath(av[0], getenv("PATH"), X_OK);