MCPcopy Create free account
hub / github.com/apache/mesos / get

Function get

src/posix/rlimits.cpp:137–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135
136
137Try<RLimitInfo::RLimit> get(RLimitInfo::RLimit::Type type)
138{
139 Try<int> _type = rlimits::convert(type);
140 if (_type.isError()) {
141 return Error(_type.error());
142 }
143
144 ::rlimit resourceLimit;
145 if (getrlimit(_type.get(), &resourceLimit) != 0) {
146 return ErrnoError();
147 }
148
149 RLimitInfo::RLimit limit;
150 limit.set_type(type);
151 if (resourceLimit.rlim_cur != RLIM_INFINITY) {
152 limit.set_soft(resourceLimit.rlim_cur);
153 }
154 if (resourceLimit.rlim_max != RLIM_INFINITY) {
155 limit.set_hard(resourceLimit.rlim_max);
156 }
157
158 return std::move(limit);
159}
160
161} // namespace rlimits {
162} // namespace internal {

Callers

nothing calls this directly

Calls 6

ErrnoErrorClass · 0.85
convertFunction · 0.70
errorMethod · 0.65
ErrorFunction · 0.50
isErrorMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected