shared-memory/main/main.cpp

19 lines
470 B
C++
Raw Normal View History

2019-10-19 17:12:14 +02:00
#include "../src/SharedMemory.h"
2019-11-06 13:07:33 +01:00
#include <unistd.h>
#include <cstdlib>
#include <iostream>
#include <signal.h>
2019-11-06 13:07:33 +01:00
int main(int argc, char** argv)
{
sharedMemoryInit();
struct sigaction sigIntHandler;
sigIntHandler.sa_handler = deleteSharedMemory;
sigemptyset(&sigIntHandler.sa_mask);
sigIntHandler.sa_flags = 0;
sigaction(SIGINT, &sigIntHandler, NULL);
sleep(3); // TODO: warte auf eingabe
std::atexit(deleteSharedMemory);
return 0;
}