12 |
|
#ifdef _WIN32 |
13 |
|
#include <windows.h> /* DWORD etc. */ |
14 |
|
#include <stdio.h> |
15 |
< |
typedef DWORD pid_t; |
15 |
> |
typedef DWORD RT_PID; |
16 |
|
#include <process.h> /* getpid() and others */ |
17 |
|
#define nice(inc) win_nice(inc) |
18 |
|
|
28 |
|
#define popen(cmd,mode) win_popen(cmd,mode) |
29 |
|
#define pclose(p) win_pclose(p) |
30 |
|
#else |
31 |
+ |
#include <stdio.h> |
32 |
|
#include <sys/param.h> |
33 |
+ |
#include <sys/types.h> |
34 |
+ |
typedef pid_t RT_PID; |
35 |
|
#endif |
36 |
|
|
37 |
|
#include "paths.h" |
45 |
|
|
46 |
|
This means that we shouldn't rely on PIDs and file descriptors |
47 |
|
being the same type, so we have to describe processes with a struct, |
48 |
< |
instead of the original int[3]. To keep things simple, we typedef |
49 |
< |
the posix pid_t on those systems that don't have it already. |
48 |
> |
instead of the original int[3]. For that purpose, we typedef a |
49 |
> |
platform independent RT_PID. |
50 |
|
*/ |
51 |
|
|
52 |
|
|
66 |
|
int r; /* read handle */ |
67 |
|
int w; /* write handle */ |
68 |
|
int running; /* doing something */ |
69 |
< |
pid_t pid; /* process ID */ |
69 |
> |
RT_PID pid; /* process ID */ |
70 |
|
} SUBPROC; |
71 |
|
|
72 |
|
#define SP_INACTIVE {-1,-1,0,0} /* for static initializations */ |