MCPcopy Create free account
hub / github.com/catboost/catboost / FreeBSDSysCtl

Function FreeBSDSysCtl

util/system/execpath.cpp:30–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30static inline int FreeBSDSysCtl(int* mib, size_t mibSize, TTempBuf& res) {
31 for (size_t i = 0; i < 2; ++i) {
32 size_t cb = res.Size();
33 if (sysctl(mib, mibSize, res.Data(), &cb, nullptr, 0) == 0) {
34 res.Proceed(cb);
35 return 0;
36 } else if (errno == ENOMEM) {
37 res = TTempBuf(cb);
38 } else {
39 return errno;
40 }
41 }
42 return errno;
43}
44
45static inline TString FreeBSDGetExecPath() {
46 int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};

Callers 2

FreeBSDGetExecPathFunction · 0.85
FreeBSDGetArgv0Function · 0.85

Calls 4

TTempBufClass · 0.85
SizeMethod · 0.45
DataMethod · 0.45
ProceedMethod · 0.45

Tested by

no test coverage detected