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

Function FreeBSDGetArgv0

util/system/execpath.cpp:64–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64static inline TString FreeBSDGetArgv0() {
65 int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_ARGS, getpid()};
66 TTempBuf buf;
67 int r = FreeBSDSysCtl(mib, Y_ARRAY_SIZE(mib), buf);
68 if (r == 0) {
69 return TString(buf.Data());
70 } else if (r == ENOTSUP) {
71 return TString();
72 } else {
73 ythrow yexception() << "FreeBSDGetArgv0() failed: " << LastSystemErrorText();
74 }
75}
76
77static inline bool FreeBSDGuessExecPath(const TString& guessPath, TString& execPath) {
78 if (NFs::Exists(guessPath)) {

Callers 1

GetExecPathImplFunction · 0.85

Calls 4

FreeBSDSysCtlFunction · 0.85
LastSystemErrorTextFunction · 0.70
getpidFunction · 0.50
DataMethod · 0.45

Tested by

no test coverage detected