Date: Thu, 10 Sep 1998 18:35:29 +1000 From: Bruce Evans <bde@zeta.org.au> To: brian@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/sys sigaction.2 Message-ID: <199809100835.SAA06155@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
> Modified files: > lib/libc/sys sigaction.2 > Log: > Mention which system interface functions are signal-safe. > Suggested on -current by: Terry Lambert <tlambert@primenet.com> I wonder if dynamic binding for calling functions in shared libraries is signal-safe. I haven't seen any good definitions of signal-safe. POSIX.1 says that the functions in the list "shall be reentrant with respect to signals (that is, applications may invoke them, without restriction [!!], from signal-catching functions)", but many of the functions in the list are inherently non-reentrant, and can not be used without restriction. E.g., any syscall: can not be used without risking clobbering errno. This may be a bug in FreeBSD, but most systems seem to have the same problem. The usual workaround of frobbing errno to preserve it is specified as working, of course (frobbing arbitrary globals is obiously not possible, and no exception is made for errno). read(): don't use this to change nonvolatile globals. setuid(): your application had better be prepared for kernel state changing underneath it if you use functions like this. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809100835.SAA06155>