--- ray/src/common/rtprocess.h 2003/07/14 20:02:29 3.3 +++ ray/src/common/rtprocess.h 2003/11/10 16:41:52 3.7 @@ -1,4 +1,4 @@ -/* RCSid $Id: rtprocess.h,v 3.3 2003/07/14 20:02:29 schorsch Exp $ */ +/* RCSid $Id: rtprocess.h,v 3.7 2003/11/10 16:41:52 greg Exp $ */ /* * rtprocess.h * Routines to communicate with separate process via dual pipes @@ -7,22 +7,40 @@ */ #ifndef _RAD_PROCESS_H_ #define _RAD_PROCESS_H_ -#ifdef __cplusplus -extern "C" { -#endif #include #ifdef _WIN32 #include /* DWORD etc. */ + #include typedef DWORD pid_t; #include /* getpid() and others */ + #define nice(inc) win_nice(inc) + + #ifdef __cplusplus + extern "C" { + #endif + extern FILE *win_popen(char *command, char *type); + extern int win_pclose(FILE *p); + #ifdef __cplusplus + } + #endif + + #define popen(cmd,mode) win_popen(cmd,mode) + #define pclose(p) win_pclose(p) #else #include #endif #include "paths.h" +#if !defined(BSD) || defined(sparc) +#define vfork fork +#endif +#ifdef __cplusplus +extern "C" { +#endif + /* On Windows, a process ID is a DWORD. That might actually be the same thing as an int, but it's better not to assume anything. @@ -30,10 +48,6 @@ extern "C" { being the same type, so we have to describe processes with a struct, instead of the original int[3]. To keep things simple, we typedef the posix pid_t on those systems that don't have it already. - - Some older Windows systems use negative PIDs. Open_process() and - close_process() will convert those to positive values during - runtime, so that client modules can still use -1 as invalid PID. */ @@ -63,6 +77,11 @@ extern int close_process(SUBPROC *pd); extern int process(SUBPROC *pd, char *recvbuf, char *sendbuf, int nbr, int nbs); extern int readbuf(int fd, char *bpos, int siz); extern int writebuf(int fd, char *bpos, int siz); + +#ifdef _WIN32 +/* any non-negative increment will send the process to IDLE_PRIORITY_CLASS. */ +extern int win_nice(int inc); +#endif #ifdef __cplusplus