mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 04:17:15 +02:00
added moenchdetector server skeleton, copy of gotthard
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@507 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
39
slsDetectorSoftware/moenchDetectorServer/sharedmemory.c
Executable file
39
slsDetectorSoftware/moenchDetectorServer/sharedmemory.c
Executable file
@ -0,0 +1,39 @@
|
||||
#include "sharedmemory.h"
|
||||
|
||||
struct statusdata *stdata;
|
||||
|
||||
int inism(int clsv) {
|
||||
|
||||
static int scansmid;
|
||||
|
||||
if (clsv==SMSV) {
|
||||
if ( (scansmid=shmget(SMKEY,1024,IPC_CREAT | 0666 ))==-1 ) {
|
||||
return -1;
|
||||
}
|
||||
if ( (stdata=shmat(scansmid,NULL,0))==(void*)-1) {
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
if (clsv==SMCL) {
|
||||
if ( (scansmid=shmget(SMKEY,0,0) )==-1 ) {
|
||||
return -3;
|
||||
}
|
||||
if ( (stdata=shmat(scansmid,NULL,0))==(void*)-1) {
|
||||
return -4;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void write_status_sm(char *status) {
|
||||
strcpy(stdata->status,status);
|
||||
}
|
||||
|
||||
void write_stop_sm(int v) {
|
||||
stdata->stop=v;
|
||||
}
|
||||
|
||||
void write_runnumber_sm(int v) {
|
||||
stdata->runnumber=v;
|
||||
}
|
Reference in New Issue
Block a user