TIP: Click on subject to list as thread! ANSI
echo: cis.languages
to: TONY CAPPELLINI 76370,2104
from: Mark Wuest 74030,332
date: 1990-07-10 09:09:32
subject: #5027-I don`t C so well !

#: 5042 S3/Languages
    10-Jul-90  09:09:32
Sb: #5027-I don't C so well !
Fm: Mark Wuest 74030,332
To: TONY CAPPELLINI 76370,2104

Tony,
 I use OSK, but I have a solution that will work. I used this back before OSK
had the alarm() calls. I wrote a program called timesig which took exactly 3
arguments: argv[1] is the process you want to signal, argv[2] is the signal to
send, and argv[3] is the time to wait (I used seconds). (Of course, argv[0] was
"timesig"). This way, you can os9fork() timesig to send yourself a signal in a
couple of seconds just before you do the write() and, if your write() returns
(-1), just check to see if you got the signal. Here's sort of what timesig
looked like:
 main(argc, argv)
 int argc;
 char *argv[];
 {
     int pid, sigval, time;

     pid = atoi(argv[1]);
     sigval = atoi(argv[2]);
     time = atoi(argv[3]);
     sleep(time);
     kill(pid,sigval);
 }

 Good luck!
 Mark

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.