123456789101112131415161718192021222324252627 |
- #include <QCoreApplication>
- #include "dataprecess.h"
- #include "dogcore.h"
- YtDashBoardShm *dataProcessShm;
- bool load_shm(){
- int shmid;
- key_t key;
- if((key = ftok(SHM_PATH,static_cast<int>(SHM_PORT)))==-1)
- return false;
- if((shmid = shmget(key,sizeof(YtDashBoardShm),IPC_CREAT|0666))==-1)
- return false;
- dataProcessShm = static_cast<YtDashBoardShm *>(shmat(shmid,nullptr,0));
- return true;
- }
- int main(int argc, char *argv[])
- {
- QCoreApplication a(argc, argv);
- if(load_shm()){
- DogCore *core = new DogCore(nullptr);
- }else{
- exit(1);
- }
- return a.exec();
- }
|