Subversion Repositories Kolibri OS

Rev

Rev 1805 | 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. #include <stdlib.h>
  5. #include <time.h>
  6.  
  7. #if defined _KOLIBRI
  8. # define DIR_SEPARATOR  ('/')
  9.   inline long GetProcessId() {return 0;}
  10.   inline long DuplicateProcess() {return -1;}
  11.   inline int random(int m) {return ((unsigned long)rand()) % m;}
  12.   inline void randomize() {srand(__menuet__getsystemclock());}
  13. #elif defined __GNUC__
  14. # include <unistd.h>
  15. # define DIR_SEPARATOR  ('/')
  16.   inline long GetProcessId() {return (long)getpid();}
  17.   inline long DuplicateProcess() {return (long)fork();}
  18.   inline int random(int m) {return ((unsigned long)rand()) % m;}
  19.   inline void randomize() {srand(time(0));}
  20. #elif defined __TURBOC__
  21. # include <process.h>
  22. # define DIR_SEPARATOR  ('\\')
  23.   inline long GetProcessId() {return (long)getpid();}
  24.   inline long DuplicateProcess() {return -1;}
  25. #else
  26. # define DIR_SEPARATOR  ('\\')
  27.   inline long GetProcessId() {return 0;}
  28.   inline long DuplicateProcess() {return -1;}
  29. #endif
  30.  
  31. #endif  //_HEADER_SYSTEM_PROCESS_H
  32.