portingtools/src/data.cpp

18 lines
313 B
C++
Raw Normal View History

2022-11-05 18:07:20 +01:00
#include "data.hpp"
#include <boost/log/trivial.hpp>
#include <cstdlib>
2022-11-07 01:01:36 +01:00
#include <stdexcept>
2022-11-05 18:07:20 +01:00
#include <sys/ipc.h>
namespace data {
key_t getIpcKeyFromExeName(char *argv0) {
auto k = ftok(argv0, 'X');
if (k < 0) {
2022-11-07 01:01:36 +01:00
throw std::runtime_error("failed to get IPC key");
2022-11-05 18:07:20 +01:00
}
return k;
}
} // namespace data