Subversion Repositories Kolibri OS

Rev

Rev 5123 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #ifndef _HEADER_SYSTEM_PROCESS_H
  2. #define _HEADER_SYSTEM_PROCESS_H
  3.  
  4. #ifndef __MENUET__
  5. #include <stdlib.h>
  6. #include <time.h>
  7. #endif
  8.  
  9. #if defined __GNUC__
  10. # include <unistd.h>
  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 <process.h>
  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
  28.