Initial Patch of Auction House bot rev. 135
[auctionmangos.git] / dep / ACE_wrappers / ace / os_include / sys / os_resource.h
blob23486b616e2208f65fe1b003bf786ce245d450e2
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file os_resource.h
7 * definitions for XSI resource operations
9 * $Id: os_resource.h 81697 2008-05-14 18:33:11Z johnnyw $
11 * @author Don Hinton <dhinton@dresystems.com>
12 * @author This code was originally in various places including ace/OS.h.
14 //=============================================================================
16 #ifndef ACE_OS_INCLUDE_SYS_OS_RESOURCE_H
17 #define ACE_OS_INCLUDE_SYS_OS_RESOURCE_H
19 #include /**/ "ace/pre.h"
21 #include "ace/config-lite.h"
23 #if !defined (ACE_LACKS_PRAGMA_ONCE)
24 # pragma once
25 #endif /* ACE_LACKS_PRAGMA_ONCE */
27 #include "ace/os_include/sys/os_time.h"
28 #include "ace/os_include/sys/os_types.h"
30 #if !defined (ACE_LACKS_SYS_RESOURCE_H)
31 # include /**/ <sys/resource.h>
32 #endif /* !ACE_LACKS_SYS_RESOURCE_H */
34 #if defined (ACE_HAS_SYS_SYSTEMINFO_H)
35 # include /**/ <sys/systeminfo.h>
36 #endif /* ACE_HAS_SYS_SYSTEMINFO_H */
38 #if defined (ACE_HAS_SYS_SYSCALL_H)
39 # include /**/ <sys/syscall.h>
40 #endif /* ACE_HAS_SYS_SYSCALL_H */
42 // prusage_t is defined in <sys/procfs.h>
43 #if defined (ACE_HAS_PROC_FS)
44 # include /**/ <sys/procfs.h>
45 #endif /* ACE_HAS_PROC_FS */
47 // Place all additions (especially function declarations) within extern "C" {}
48 #ifdef __cplusplus
49 extern "C"
51 #endif /* __cplusplus */
53 // There must be a better way to do this...
54 #if !defined (RLIMIT_NOFILE) && !defined (ACE_LACKS_RLIMIT_NOFILE)
55 # if defined (linux) || defined (AIX) || defined (SCO)
56 # if defined (RLIMIT_OFILE)
57 # define RLIMIT_NOFILE RLIMIT_OFILE
58 # else
59 # define RLIMIT_NOFILE 200
60 # endif /* RLIMIT_OFILE */
61 # endif /* defined (linux) || defined (AIX) || defined (SCO) */
62 #endif /* RLIMIT_NOFILE */
64 #if defined (ACE_WIN32)
65 # define RUSAGE_SELF 1
66 /// Fake the UNIX rusage structure. Perhaps we can add more to this
67 /// later on?
68 struct rusage
70 FILETIME ru_utime;
71 FILETIME ru_stime;
73 #endif /* ACE_WIN32 */
75 #if defined (ACE_LACKS_RLIMIT_PROTOTYPE)
76 int getrlimit (int resource, struct rlimit *rlp);
77 int setrlimit (int resource, const struct rlimit *rlp);
78 #endif /* ACE_LACKS_RLIMIT_PROTOTYPE */
80 #if defined (ACE_HAS_PRUSAGE_T)
81 typedef prusage_t ACE_Rusage;
82 #elif defined (ACE_HAS_GETRUSAGE)
83 typedef rusage ACE_Rusage;
84 #else
85 typedef int ACE_Rusage;
86 #endif /* ACE_HAS_PRUSAGE_T */
88 #if !defined (ACE_WIN32)
89 // These prototypes are chronically lacking from many versions of UNIX.
90 # if !defined (ACE_HAS_GETRUSAGE_PROTOTYPE)
91 int getrusage (int who, struct rusage *rusage);
92 # endif /* ! ACE_HAS_GETRUSAGE_PROTOTYPE */
94 # if defined (ACE_LACKS_SYSCALL)
95 int syscall (int, ACE_HANDLE, struct rusage *);
96 # endif /* ACE_LACKS_SYSCALL */
97 #endif /* !ACE_WIN32 */
99 #ifdef __cplusplus
101 #endif /* __cplusplus */
103 #include /**/ "ace/post.h"
104 #endif /* ACE_OS_INCLUDE_SYS_OS_RESOURCE_H */