aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-08-26 01:13:25 +0000
committerUlrich Drepper <drepper@redhat.com>2002-08-26 01:13:25 +0000
commitf51dadcc36ae43517182b44720c7b1a8d10ffe1a (patch)
tree011a11991463da97279e120cf03c073a1fbdad9f /manual
parentb9cbf9d72130f1bd3da48ac94cb1754c97c2bbcd (diff)
downloadglibc-f51dadcc36ae43517182b44720c7b1a8d10ffe1a.zip
glibc-f51dadcc36ae43517182b44720c7b1a8d10ffe1a.tar.gz
glibc-f51dadcc36ae43517182b44720c7b1a8d10ffe1a.tar.bz2
(Setting an Alarm): Document that SA_RESTART must not be set when y sycall has to be interrupted.
Diffstat (limited to 'manual')
-rw-r--r--manual/time.texi9
1 files changed, 9 insertions, 0 deletions
diff --git a/manual/time.texi b/manual/time.texi
index 645c876..e76dfe7 100644
--- a/manual/time.texi
+++ b/manual/time.texi
@@ -2301,6 +2301,15 @@ could cause the timer to expire before your program establishes the
handler. In this case it would be terminated, since termination is the
default action for the alarm signals. @xref{Signal Handling}.
+To be able to use the alarm function to interrupt a system call which
+might block otherwise indefinitely it is important to @emph{not} set the
+@code{SA_RESTART} flag when registering the signal handler using
+@code{sigaction}. When not using @code{sigaction} things get even
+uglier: the @code{signal} function has to fixed semantics with respect
+to restarts. The BSD semantics for this function is to set the flag.
+Therefore, if @code{sigaction} for whatever reason cannot be used, it is
+necessary to use @code{sysv_signal} and not @code{signal}.
+
The @code{setitimer} function is the primary means for setting an alarm.
This facility is declared in the header file @file{sys/time.h}. The
@code{alarm} function, declared in @file{unistd.h}, provides a somewhat