23 #include <spdlog/details/format.h> 26 #include <sys/prctl.h> 27 #include <sys/syscall.h> 34 return static_cast<uint64_t
>(syscall(SYS_gettid));
39 int ret = prctl(PR_SET_NAME, name.c_str(), NULL, NULL, NULL);
41 fmt::format(
"Failed to set thread name. Errno {}", errno));
uint64_t gettid()
Return the Linux thread ID.
This is the header file for a generated source file, GitSHA1.cpp.
void set_thread_name(const std::string &name)
Set the name of the current thread.
#define LEOSAC_ENFORCE(cond,...)
Similar to enforce, except that it will throw a LEOSACException.
std::string format(const std::string &escape_code, const T &in)
Return a string containing the escape code, a string representation of T and the clear escape string...