00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 #ifndef ACE_OS_INCLUDE_SYS_OS_RESOURCE_H
00017 #define ACE_OS_INCLUDE_SYS_OS_RESOURCE_H
00018 
00019 #include  "ace/pre.h"
00020 
00021 #include "ace/config-lite.h"
00022 
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif 
00026 
00027 #include "ace/os_include/sys/os_time.h"
00028 #include "ace/os_include/sys/os_types.h"
00029 
00030 #if !defined (ACE_LACKS_SYS_RESOURCE_H)
00031 #  include  <sys/resource.h>
00032 #endif 
00033 
00034 #if defined (ACE_HAS_SYSINFO)
00035 #  include  <sys/systeminfo.h>
00036 #endif 
00037 
00038 #if defined (ACE_HAS_SYS_SYSCALL_H)
00039 #  include  <sys/syscall.h>
00040 #endif 
00041 
00042 
00043 #if defined (ACE_HAS_PROC_FS)
00044 #  include  <sys/procfs.h>
00045 #endif  
00046 
00047 
00048 #ifdef __cplusplus
00049 extern "C"
00050 {
00051 #endif 
00052 
00053 
00054 #if !defined (RLIMIT_NOFILE)
00055 #  if defined (linux) || defined (AIX) || defined (SCO)
00056 #    if defined (RLIMIT_OFILE)
00057 #      define RLIMIT_NOFILE RLIMIT_OFILE
00058 #    else
00059 #      define RLIMIT_NOFILE 200
00060 #    endif 
00061 #  endif 
00062 #endif 
00063 
00064 #if defined (ACE_WIN32)
00065 #  define RUSAGE_SELF 1
00066 
00067 
00068    struct rusage
00069    {
00070      FILETIME ru_utime;
00071      FILETIME ru_stime;
00072    };
00073 #endif 
00074 
00075 #if defined (ACE_LACKS_RLIMIT_PROTOTYPE)
00076   int getrlimit (int resource, struct rlimit *rlp);
00077   int setrlimit (int resource, const struct rlimit *rlp);
00078 #endif 
00079 
00080 #if defined (ACE_HAS_PRUSAGE_T)
00081    typedef prusage_t ACE_Rusage;
00082 #elif defined (ACE_HAS_GETRUSAGE)
00083    typedef rusage ACE_Rusage;
00084 #else
00085    typedef int ACE_Rusage;
00086 #endif 
00087 
00088 #if !defined (ACE_WIN32)
00089 
00090 # if !defined (ACE_HAS_GETRUSAGE_PROTOTYPE)
00091   int getrusage (int who, struct rusage *rusage);
00092 # endif 
00093 
00094 # if defined (ACE_LACKS_SYSCALL)
00095   int syscall (int, ACE_HANDLE, struct rusage *);
00096 # endif 
00097 #endif 
00098 
00099 #ifdef __cplusplus
00100 }
00101 #endif 
00102 
00103 #include  "ace/post.h"
00104 #endif