Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!math.fu-berlin.de!opal!unido!mcshh!abqhh!tpki!oski!schlut From: schlut@oski.toppoint.de (Olaf Schlueter) Newsgroups: comp.os.minix Subject: Re: Vi and alarm. Message-ID: <4@oski.toppoint.de> Date: 26 Mar 91 19:13:02 GMT References: <2996@redstar.cs.qmw.ac.uk> <79@oski.toppoint.de> Organization: Toppoint Mailbox Lines: 23 So, thanks to Bruce Evans, I have to correct myself: schlut@oski.toppoint.de (Olaf Schlueter) writes: >You can watch the bug working in: > do { > alarm(1); n = read (1,&c,1); alarm(0) } while( n > 0); >} >run this program and hold the "a" key pressed. In normal v7 Unix that >programm will stop within a second after releasing "a". In Minix >the program runs 1 second, whether you press "a" or not. I've been wrong :-( This simple version fails as for the buffering read. If you set RAW-Mode (and by the way read from stdin rather then stdout, bad typ-O), everything works as expected from v7 unix. Bruce thinks, there is a race condition, the alarm may expire after the read, but before the alarm(0) call - this would explain, why it is only seen on slow machines. -- Olaf Schlueter, Sandkuhle 4-6, 2300 Kiel 1, FRG, schlut@oski.toppoint.de "Someone is always the evil in the land, and hhhcor: : :an be v7rourourI I IufufusasasherVd (d (d