| 62 | } |
| 63 | |
| 64 | static 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 | |
| 77 | static inline bool FreeBSDGuessExecPath(const TString& guessPath, TString& execPath) { |
| 78 | if (NFs::Exists(guessPath)) { |
no test coverage detected