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 ACE_OSCALL_RETURN (::getrlimit ((ACE_HAS_RLIMIT_RESOURCE_ENUM) resource, rl), int, -1);
21 ACE_OSCALL_RETURN (::getrlimit (resource, rl), int, -1);
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)
35 # if defined (ACE_LACKS_GETPROCESSTIMES)
37 ACE_NOTSUP_RETURN (-1);
41 ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::GetProcessTimes (::GetCurrentProcess(),
48 # endif /* ACE_LACKS_WIN32_GETPROCESSTIMES */
50 # if defined (ACE_HAS_RUSAGE_WHO_ENUM)
51 ACE_OSCALL_RETURN (::getrusage ((ACE_HAS_RUSAGE_WHO_ENUM) who, ru), int, -1);
53 ACE_OSCALL_RETURN (::getrusage (who, ru), int, -1);
54 # endif /* ACE_HAS_RUSAGE_WHO_ENUM */
55 # endif /* ACE_WIN32 */
59 ACE_NOTSUP_RETURN (-1);
60 #endif /* ACE_HAS_GETRUSAGE */
64 ACE_OS::setrlimit (int resource, const struct rlimit *rl)
66 ACE_OS_TRACE ("ACE_OS::setrlimit");
68 #if defined (ACE_LACKS_RLIMIT)
69 ACE_UNUSED_ARG (resource);
72 ACE_NOTSUP_RETURN (-1);
74 # if defined (ACE_HAS_RLIMIT_RESOURCE_ENUM)
75 # if defined (ACE_HAS_NONCONST_SETRLIMIT)
76 ACE_OSCALL_RETURN (::setrlimit ((ACE_HAS_RLIMIT_RESOURCE_ENUM) resource,
77 const_cast<struct rlimit *>(rl)
80 ACE_OSCALL_RETURN (::setrlimit ((ACE_HAS_RLIMIT_RESOURCE_ENUM) resource,
83 # endif /* ACE_HAS_NONCONST_SETRLIMIT */
84 # else /* ACE_HAS_RLIMIT_RESOURCE_ENUM */
85 # if defined (ACE_HAS_NONCONST_SETRLIMIT)
86 ACE_OSCALL_RETURN (::setrlimit (resource, const_cast<struct rlimit *>(rl)
89 ACE_OSCALL_RETURN (::setrlimit (resource, rl), int, -1);
90 # endif /* ACE_HAS_NONCONST_SETRLIMIT */
91 # endif /* ACE_HAS_RLIMIT_RESOURCE_ENUM */
92 #endif /* ACE_LACKS_RLIMIT */
95 ACE_END_VERSIONED_NAMESPACE_DECL