--- ray/src/common/rtprocess.h 2004/01/28 12:42:22 3.10 +++ ray/src/common/rtprocess.h 2018/03/20 17:45:07 3.17 @@ -1,4 +1,4 @@ -/* RCSid $Id: rtprocess.h,v 3.10 2004/01/28 12:42:22 schorsch Exp $ */ +/* RCSid $Id: rtprocess.h,v 3.17 2018/03/20 17:45:07 greg Exp $ */ /* * rtprocess.h * Routines to communicate with separate process via dual pipes @@ -9,26 +9,15 @@ #define _RAD_PROCESS_H_ #include -#ifdef _WIN32 +#include +#if defined(_WIN32) || defined(_WIN64) #include /* DWORD etc. */ - #include typedef DWORD RT_PID; #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) + #define getpid _getpid + #define execv _execv + #define execvp _execvp #else - #include #include #include typedef pid_t RT_PID; @@ -71,14 +60,17 @@ typedef struct { #define SP_INACTIVE {-1,-1,0,0} /* for static initializations */ +#define close_process(pd) close_processes(pd,1) + extern int open_process(SUBPROC *pd, char *av[]); -extern int close_process(SUBPROC *pd); +extern int close_processes(SUBPROC pd[], int nproc); 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 +#if defined(_WIN32) || defined(_WIN64) /* any non-negative increment will send the process to IDLE_PRIORITY_CLASS. */ +extern int win_kill(RT_PID pid, int sig /* ignored */); extern int win_nice(int inc); #endif