18 lines
307 B
C++
18 lines
307 B
C++
|
#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
|