Change prototype of comedi_get_cmd_generic_timed
[comedilib.git] / testing / mmap.c
index d0a94ea337a58c42dded83507e3bab8da2fe1470..a859b8f437e22fabc8f4c1635655b579392a6a4c 100644 (file)
@@ -28,7 +28,7 @@
 
 jmp_buf jump_env;
 
-void segv_handler(int num,siginfo_t *si,void *x)
+void segv_handler(int num)
 {
        longjmp(jump_env,1);
 }
@@ -48,8 +48,7 @@ void setup_segfaulter(void)
        struct sigaction act;
 
        memset(&act,0,sizeof(act));
-       act.sa_sigaction=&segv_handler;
-       act.sa_flags = SA_SIGINFO;
+       act.sa_handler=&segv_handler;
        sigaction(SIGSEGV,&act,NULL);
 }
 
@@ -69,7 +68,7 @@ int test_mmap(void)
                return 0;
        }
 
-       if(comedi_get_cmd_generic_timed(device,subdevice,&cmd)<0){
+       if(comedi_get_cmd_generic_timed(device,subdevice,&cmd,1)<0){
                printf("E: comedi_get_cmd_generic_timed failed\n");
                return 0;
        }
@@ -94,6 +93,8 @@ int test_mmap(void)
                }
        }
 
+       if(realtime)cmd.flags |= TRIG_RT;
+
        cmd.chanlist = chanlist;
        cmd.scan_end_arg = 1;
        cmd.stop_arg = N_SAMPLES;
@@ -118,7 +119,7 @@ int test_mmap(void)
                }else{
                        total += ret;
                        b += ret;
-                       printf("read %d %d\n",ret,total);
+                       if(verbose) printf("read %d %d\n",ret,total);
                }
        }
        if(memcmp(buf,map,total)){