00001
00002
00003 #ifndef _BCP_OS_H
00004 #define _BCP_OS_H
00005
00006
00007 #if HAVE_SYS_RESOURCE_H
00008 # include <sys/resource.h>
00009 #else
00010 # define setpriority(x,y,z)
00011 #endif
00012
00013 #if HAVE_UNISTD_H
00014 # include <unistd.h>
00015 #endif
00016
00017 #ifndef HAVE_GETHOSTNAME
00018 # define gethostname(x,y)
00019 #endif
00020
00021 #if HAVE_GETPID
00022 # define GETPID (getpid())
00023 #else
00024 # define GETPID (0)
00025 #endif
00026
00028 #if 0
00029
00031 #ifdef HAVE_SYSINFO
00032 #include <sys/sysinfo.h>
00033 static inline int freemem() {
00034 struct sysinfo info;
00035 sysinfo(&info);
00036 return (info.mem_unit*info.freeram)/1024;
00037 }
00038 #else
00039 static inline int freemem() {
00040 return -1;
00041 }
00042 #endif
00043 #endif
00044
00045 #endif