- Added a sinq module for monitoring the Accelerator broadcast
- Added automatic notification via SMS SKIPPED: psi/dgrambroadcast.c psi/dgrambroadcast.h psi/make_gen psi/psi.c psi/sinq.c psi/sinq.h
This commit is contained in:
@ -47,12 +47,23 @@ OUTPUT PARAMETERS (Nsum, psum, p2sum,currentCount)
|
||||
STATE PARAMETERS (x,y,z,vx,vy,vz,t,s1,s2,p)
|
||||
SHARE
|
||||
%{
|
||||
#include <fcntl.h>
|
||||
void dumpTotal(char *ffilename, long totalCounts){
|
||||
FILE *fd = NULL;
|
||||
struct flock fl;
|
||||
|
||||
fl.l_type = F_WRLCK;
|
||||
fl.l_whence = 0;
|
||||
fl.l_start = 0;
|
||||
fl.l_len = 0;
|
||||
fl.l_pid = getpid();
|
||||
|
||||
fd = fopen(ffilename,"w");
|
||||
if(fd != NULL){
|
||||
fcntl(fileno(fd),F_SETLKW,&fl);
|
||||
fprintf(fd,"%ld\n",totalCounts);
|
||||
fl.l_type = F_UNLCK;
|
||||
fcntl(fileno(fd),F_SETLK,&fl);
|
||||
fclose(fd);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user