summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2001-07-24 08:24:50 +0000
committerkris <kris@FreeBSD.org>2001-07-24 08:24:50 +0000
commit2dedab32be967c8a072e51840eac473b80eedd26 (patch)
tree181fe4bd440d3a7b1e4068ef07f5a16bce5fdf99 /lib
parent267cc8ea9207e236eeeb4b857f1a2c54a8885bb4 (diff)
downloadFreeBSD-src-2dedab32be967c8a072e51840eac473b80eedd26.zip
FreeBSD-src-2dedab32be967c8a072e51840eac473b80eedd26.tar.gz
Add a few more functions which are safe to call from signal handlers,
and give a bit of advice. Obtained from: OpenBSD MFC After: 1 week
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/sys/sigaction.220
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/libc/sys/sigaction.2 b/lib/libc/sys/sigaction.2
index 1d1c98f..51bd2b9 100644
--- a/lib/libc/sys/sigaction.2
+++ b/lib/libc/sys/sigaction.2
@@ -418,9 +418,29 @@ Realtime Interfaces:
.Fn sigset ,
.Fn timer_settime .
.Pp
+ANSI C Interfaces:
+.Pp
+.Fn strcpy ,
+.Fn strcat ,
+.Fn strncpy ,
+.Fn strncat ,
+and perhaps some others.
+.Pp
+Extension Interfaces:
+.Pp
+.Fn strlcpy ,
+.Fn strlcat .
+.Pp
All functions not in the above lists are considered to be unsafe
with respect to signals. That is to say, the behaviour of such
functions when called from a signal handler is undefined.
+In general though, signal handlers should do little more than set a
+flag; most other actions are not safe.
+.Pp
+As well, inside the signal handler it is also considered more safe to
+make a copy the global variable
+.Va errno
+and restore it before returning from the signal handler.
.Sh RETURN VALUES
A 0 value indicated that the call succeeded. A \-1 return value
indicates an error occurred and
OpenPOWER on IntegriCloud