3 # check out customized signal handlers
5 # USAGE: qa-setsig <low-bound> <high-bound>
7 # example: qa-setsig 1 8
9 # checks all signals between 1 and 8
11 # run without arguments for testing 1-8, 10-16
16 (set 'opsys (& 0xF ((sys-info) -1)))
19 (= opsys 1) "libc.so.6" ;; Linux
20 (= opsys 2) "libc.so" ;; FreeBSD
21 (= opsys 3) "libc.dylib" ;; Mac OSX
22 (= opsys 4) "libc.so")) ;; Solaris
26 (println "Cannot run qa-signal on this platform")
29 (import library "getpid")
30 (import library "kill")
32 (set 'low (int (main-args 2)))
33 (set 'high (int (main-args 3)))
37 (println "low=" low " hight=" high " pid=" pid))
40 (if (= sig high) (set 'done true))
41 (print "sig-" sig " ")
42 (push sig result-list -1)
46 (set 'sig-list (sequence low high))
47 (set 'sig-list (append (sequence 1 8) (sequence 10 16))))
49 (set 'high (last sig-list))
51 (dolist (s sig-list) (signal s 'alarm))
63 (while (not done) (print ".") (sleep 100))
65 (println "sent: " sig-list)
66 (println "received: " result-list)
67 (if (= result-list sig-list)
68 (println "signal testing OK")
69 (println "ERROR: problem in signal testing"))