summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/signal.3
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2003-02-03 21:20:40 +0000
committerderaadt <deraadt@openbsd.org>2003-02-03 21:20:40 +0000
commit81f7948bbabc4aeb86718e187b53724d2dc5cffc (patch)
treef40c9058db870410f4608b32a691ba179913772e /lib/libc/gen/signal.3
parentpad tx buffer out to minimum framelength; based on NetBSD (diff)
downloadwireguard-openbsd-81f7948bbabc4aeb86718e187b53724d2dc5cffc.tar.xz
wireguard-openbsd-81f7948bbabc4aeb86718e187b53724d2dc5cffc.zip
some more functions that are (only on OpenBSD) safe in signal handlers.
not having access to these makes things really painful
Diffstat (limited to 'lib/libc/gen/signal.3')
-rw-r--r--lib/libc/gen/signal.318
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/libc/gen/signal.3 b/lib/libc/gen/signal.3
index 550e3e5e46a..98248f5bac4 100644
--- a/lib/libc/gen/signal.3
+++ b/lib/libc/gen/signal.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: signal.3,v 1.18 2002/04/30 16:31:42 mpech Exp $
+.\" $OpenBSD: signal.3,v 1.19 2003/02/03 21:20:47 deraadt Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -337,7 +337,7 @@ Extension Interfaces:
.Fn strlcat ,
.Fn syslog_r .
.Pp
-All functions not in the above lists are considered to be unsafe
+Most 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.
@@ -348,6 +348,20 @@ 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.
+.Pp
+A few other functions are signal race safe in
+.Ox
+but probably not on other systems:
+.Pp
+.Bl -tag -offset indent -compact -width foofoofoofoo
+.It Fn snprintf
+Safe as long as $n positional arguments are not used.
+.It Fn syslog_r
+Safe if the
+.Va syslog_data
+struct is initialized as a local variable.
+.El
+.Pp
.Sh RETURN VALUES
The previous action is returned on a successful call.
Otherwise,