delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/03/11/01:01:27

Date: Mon, 11 Mar 1996 07:52:52 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Charles Sandmann <sandmann AT clio DOT rice DOT edu>
Cc: Douglas Rupp <drupp AT cs DOT washington DOT edu>, djgpp-workers AT delorie DOT com
Subject: Re: Itimer/Signal handler bug?
In-Reply-To: <9603110404.AA13684@clio.rice.edu>
Message-Id: <Pine.SUN.3.91.960311074809.3850D-100000@is>
Mime-Version: 1.0

On Sun, 10 Mar 1996, Charles Sandmann wrote:

> The problem in the test program is that the signal handler does a printf -
> and this somehow hoses the I/O library.  If you remove the printf and just
> increment a variable instead it works.  If you change the printf to a
> "cprintf" it also works.  This actually doesn't surprise me too much, since

`printf' calls DOS.  If there is anything signal handlers should avoid, 
it's calling DOS functions, even if it sometimes works.  Low-level 
library functions might also be subtly non-reentrant if whoever 
interrupts them in the middle uses the transfer buffer (like `printf', or 
any other function that calls real-mode services) does.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019