gets() during signal
Anton Rang
rang at cs.wisc.edu
Tue Dec 11 08:49:15 AEST 1990
In article <25232 at adm.brl.mil> stanonik at nprdc.navy.mil (Ron Stanonik) writes:
>I just ran into a problem while porting a program from 4.3bsd to
>sunos4.1. The problem is that gets() in signal handlers seems to
>reset stdio's write pointer, but not the read pointer.
As far as I know, UNIX stdio packages are not re-entrant. Don't try
to use any of the input routines, in particular, inside a signal
handler. I'm not sure if the output routines are safe, but I wouldn't
count on them--I've seen implementations of printf() which used a
static buffer internally.
I've moved followups to comp.unix.programmer, which is probably
where this really belongs... (?)
Anton
+---------------------------+------------------+-------------+
| Anton Rang (grad student) | rang at cs.wisc.edu | UW--Madison |
+---------------------------+------------------+-------------+
More information about the Comp.unix.programmer
mailing list