Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!eap From: eap@bu-cs.BU.EDU (Eric Pearce) Newsgroups: comp.unix.questions Subject: Re: help needed with signal(2) Message-ID: <22764@bu-cs.BU.EDU> Date: 20 May 88 14:27:01 GMT References: <660@amethyst.ma.arizona.edu> Reply-To: eap@bu-it.bu.edu (Eric Pearce) Followup-To: comp.unix.questions Distribution: na Organization: BD&HR (Beer Drinkers & Hell Raisers) Lines: 27 In article <660@amethyst.ma.arizona.edu> eros!barsam@arizona.edu says: >I have a C program that runs continuously. I would like >to get its attention by hitting the key. I can do >it using signal(2) with SIGINT or SIGQUIT but I don't want >to use interrupt or quit, and I couldn't figure out how to >do it with . Any help (preferably with e-mail) would >be greatly appreciated. If you are using BSD, why don't you use this instead: #include int count; for (;;) { /* endless loop */ ioctl(0,FIONREAD,&count); if (count) { /* key was pressed */ } else { /* nothing happened */ } } -- ------------------------------------------------------------------------------- UUCP !harvard!bu-cs!bu-it!eap ARPANET eap@bu-it.bu.edu CSNET eap%bu-it@bu-cs JNET jnet%"ep@buenga" * Hanging out in the Q Continuum * BITNET iteap@buacca