Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!eurifb!euraiv1!aiv From: aiv@euraiv1.UUCP (Eelco van Asperen) Newsgroups: comp.unix.questions Subject: catching signals while writing to a tty-line Message-ID: <589@euraiv1.UUCP> Date: Thu, 3-Sep-87 10:26:28 EDT Article-I.D.: euraiv1.589 Posted: Thu Sep 3 10:26:28 1987 Date-Received: Sat, 5-Sep-87 16:55:04 EDT Organization: Erasmus University EF/AIV,Rotterdam,Netherlands Lines: 30 Keywords: signal;slow i/o Hi, I have a problem regarding the use of alarm() in combination with writing to a tty-line. The tty-line is put in raw-mode and write() is used to send data; I would like to use alarm() to detect timeouts and warn the user of my program of this event. After displaying this warning, the program should continue sending data. Now, upon reading the man-page for signal() it said: "when a signal that is to be caught occurs during a read, a write, an open, or an ioctl system call on a slow device (like a terminal; but not a file), during a pause system call, or during a wait system call that does not return immediately due to the existence of a previously stopped or zombie process, the signal catching function will be executed and the interrupted system call will return -1 to the calling process with errno set to EINTR." (btw, I use System V release 2.0 on an AT&T 3B2/300) The problem is of course to detect the number of characters that has already been written so that we don't send chars twice or not at all. Thanks in advance for the brain-cycles you use to answer my question, Eelco van Asperen. -----------------------------------------+------------------------------ Erasmus University Rotterdam |uucp:mcvax!eurifb!euraiv1!evas Fac. of Economics, Computer Science Dept.|earn:asperen@hroeur5 PO.box 1738 / 3000 DR Rotterdam | T H E N E T H E R L A N D S |Yet Another Silly Signature. -----------------------------------------+------------------------------