Rev 5123 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1805 | yogev_ezra | 1 | #ifndef _HEADER_SYSTEM_PROCESS_H |
2 | #define _HEADER_SYSTEM_PROCESS_H |
||
3 | |||
4 | #ifndef __MENUET__ |
||
5 | #include |
||
6 | #include |
||
7 | #endif |
||
8 | |||
9 | #if defined __GNUC__ |
||
10 | # include |
||
11 | # define DIR_SEPARATOR ('/') |
||
12 | inline long GetProcessId() {return (long)getpid();} |
||
13 | inline long DuplicateProcess() {return (long)fork();} |
||
14 | inline int random(int m) {return ((unsigned long)rand()) % m;} |
||
15 | inline void randomize() {srand(time(0));} |
||
16 | #elif defined __TURBOC__ && !defined __MENUET__ |
||
17 | # include |
||
18 | # define DIR_SEPARATOR ('\\') |
||
19 | inline long GetProcessId() {return (long)getpid();} |
||
20 | inline long DuplicateProcess() {return -1;} |
||
21 | #else |
||
22 | # define DIR_SEPARATOR ('\\') |
||
23 | inline long GetProcessId() {return 0;} |
||
24 | inline long DuplicateProcess() {return -1;} |
||
25 | #endif |
||
26 | |||
27 | #endif //_HEADER_SYSTEM_PROCESS_H |