C+signals

Giorgos Keramidas keramida at ceid.upatras.gr
Fri Oct 29 03:02:03 EEST 1999


Kosmidhs Harris <kosmidhh at erato.unice.fr> writes:

> Mia erothsh.
> Exo ena programmataki pou kanei POLLA loops allazontas enan pinaka.
> Epeidh den teleionei (h bariemai na perimeno) to skotono me Control-C.

Kai polu kala kaneis :P

> Pos mporo na kano trap to Control-C oste anti na kanei exit kateu8eian
> na grafei ton pinaka se ena arxeio? (dhaldh na ektelei mia function).

Theleis na ftiakseis ena diko sou signal-handler gia to signal SIGINT,
to opoio einai sinithos auto pou stelnei to Ctrl-C.  Kane

	% man signal

gia na deis pws ginetai auto.  Kai gia na deis ola ta signals, nomizo
pos arkei na diabaseis to /usr/include/signal.h H kapoio allo auto kanei
#include, opws /usr/include/asm/signal.h ktl.

Kali idea einai na kaneis to signal handler sou na xeirizetai kai to
SIGTERM pou einai to default signal pou stelnei i entoli

	% kill PID

gia na doulepsei ki otan bgeis apo alli konsola kai to skotwseis :)

-- 
Giorgos Keramidas, <keramida at ceid.upatras.gr>
"What we have to learn to do, we learn by doing." [Aristotle]
--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at hellug.gr
Ta archives tis listas einai sto http://lists.hellug.gr/archives
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users at hellug.gr
====================================================================



More information about the Linux-greek-users mailing list