2 #include "ace/OS_NS_errno.h"
3 #include "ace/OS_NS_macros.h"
5 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
8 ACE_OS::getrlimit (int resource, struct rlimit *rl)
10 ACE_OS_TRACE ("ACE_OS::getrlimit");
12 #if defined (ACE_LACKS_RLIMIT)
13 ACE_UNUSED_ARG (resource);
16 ACE_NOTSUP_RETURN (-1);
18 # if defined (ACE_HAS_RLIMIT_RESOURCE_ENUM)
19 return ::getrlimit ((ACE_HAS_RLIMIT_RESOURCE_ENUM) resource, rl);
21 return ::getrlimit (resource, rl);
22 # endif /* ACE_HAS_RLIMIT_RESOURCE_ENUM */
23 #endif /* ACE_LACKS_RLIMIT */
27 ACE_OS::getrusage (int who, struct rusage *ru)
29 ACE_OS_TRACE ("ACE_OS::getrusage");
31 #if defined (ACE_HAS_GETRUSAGE)
32 # if defined (ACE_WIN32)
36 ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::GetProcessTimes (::GetCurrentProcess(),
44 # if defined (ACE_HAS_RUSAGE_WHO_ENUM)
45 return ::getrusage ((ACE_HAS_RUSAGE_WHO_ENUM) who, ru);
47 return ::getrusage (who, ru);
48 # endif /* ACE_HAS_RUSAGE_WHO_ENUM */
49 # endif /* ACE_WIN32 */
53 ACE_NOTSUP_RETURN (-1);
54 #endif /* ACE_HAS_GETRUSAGE */
58 ACE_OS::setrlimit (int resource, const struct rlimit *rl)
60 ACE_OS_TRACE ("ACE_OS::setrlimit");
62 #if defined (ACE_LACKS_RLIMIT)
63 ACE_UNUSED_ARG (resource);
66 ACE_NOTSUP_RETURN (-1);
68 # if defined (ACE_HAS_RLIMIT_RESOURCE_ENUM)
69 # if defined (ACE_HAS_NONCONST_SETRLIMIT)
70 return ::setrlimit ((ACE_HAS_RLIMIT_RESOURCE_ENUM) resource, const_cast<struct rlimit *>(rl));
72 return ::setrlimit ((ACE_HAS_RLIMIT_RESOURCE_ENUM) resource, rl);
73 # endif /* ACE_HAS_NONCONST_SETRLIMIT */
74 # else /* ACE_HAS_RLIMIT_RESOURCE_ENUM */
75 # if defined (ACE_HAS_NONCONST_SETRLIMIT)
76 return ::setrlimit (resource, const_cast<struct rlimit *>(rl));
78 return ::setrlimit (resource, rl);
79 # endif /* ACE_HAS_NONCONST_SETRLIMIT */
80 # endif /* ACE_HAS_RLIMIT_RESOURCE_ENUM */
81 #endif /* ACE_LACKS_RLIMIT */
84 ACE_END_VERSIONED_NAMESPACE_DECL