portingtools/src/data.cpp

18 lines
307 B
C++
Raw Normal View History

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