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 #else
00074 # if defined (m88k)
00075 # define RUSAGE_SELF 1
00076 # endif
00077 #endif
00078
00079 #if defined (ACE_LACKS_RLIMIT_PROTOTYPE)
00080 int getrlimit (int resource, struct rlimit *rlp);
00081 int setrlimit (int resource, const struct rlimit *rlp);
00082 #endif
00083
00084 #if defined (ACE_HAS_PRUSAGE_T)
00085 typedef prusage_t ACE_Rusage;
00086 #elif defined (ACE_HAS_GETRUSAGE)
00087 typedef rusage ACE_Rusage;
00088 #else
00089 typedef int ACE_Rusage;
00090 #endif
00091
00092 #if !defined (ACE_WIN32)
00093
00094
00095 # if !defined (ACE_HAS_GETRUSAGE_PROTOTYPE)
00096 int getrusage (int who, struct rusage *rusage);
00097 # endif
00098
00099 # if defined (ACE_LACKS_SYSCALL)
00100 int syscall (int, ACE_HANDLE, struct rusage *);
00101 # endif
00102 #endif
00103
00104 #ifdef __cplusplus
00105 }
00106 #endif
00107
00108 #include "ace/post.h"
00109 #endif