summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-01-29 08:58:51 +0000
committerUlrich Drepper <drepper@redhat.com>2002-01-29 08:58:51 +0000
commitafdef815547ff44caf8f65e7fd107ca482896284 (patch)
tree87b316378f05b05f467f123aaf6f9c8562b8e72e
parent92f120d446433f74d4d2612587bb38a992050a04 (diff)
Update.
* manual/signal.texi (Process Signal Mask): Document that pthread_sigmask, not sigprocmask, must be used in MT programs. Patch by Bertold Kolics <Bertold.Kolics@Sun.COM>.
-rw-r--r--ChangeLog4
-rw-r--r--manual/search.texi18
-rw-r--r--manual/signal.texi6
3 files changed, 19 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index c2742e7e9f..9875e70e63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2002-01-29 Ulrich Drepper <drepper@redhat.com>
+ * manual/signal.texi (Process Signal Mask): Document that
+ pthread_sigmask, not sigprocmask, must be used in MT programs.
+ Patch by Bertold Kolics <Bertold.Kolics@Sun.COM>.
+
* misc/hsearch_r.c (hsearch_r): Don't insert anything if entry is
found.
* misc/Makefile (tests): Add tst-hsearch.
diff --git a/manual/search.texi b/manual/search.texi
index eb6786d188..fdc4a7ee1c 100644
--- a/manual/search.texi
+++ b/manual/search.texi
@@ -330,20 +330,20 @@ this element might stay undefined since it is not used.
To search in a hashing table created using @code{hcreate} the
@code{hsearch} function must be used. This function can perform simple
search for an element (if @var{action} has the @code{FIND}) or it can
-alternatively insert the key element into the hashing table, possibly
-replacing a previous value (if @var{action} is @code{ENTER}).
+alternatively insert the key element into the hashing table. Entries
+are never replaced.
The key is denoted by a pointer to an object of type @code{ENTRY}. For
locating the corresponding position in the hashing table only the
@code{key} element of the structure is used.
-The return value depends on the @var{action} parameter value. If it is
-@code{FIND} the value is a pointer to the matching element in the
-hashing table or @code{NULL} if no matching element exists. If
-@var{action} is @code{ENTER} the return value is only @code{NULL} if the
-programs runs out of memory while adding the new element to the table.
-Otherwise the return value is a pointer to the element in the hashing
-table which contains newly added element based on the data in @var{key}.
+If an entry with matching key is found the @var{action} parameter is
+irrelevant. The found entry is returned. If no matching entry is found
+and the @var{action} parameter has the value @code{FIND} the function
+returns a @code{NULL} pointer. If no entry is found and the
+@var{action} parameter has the value @code{ENTER} a new entry is added
+to the hashing table which is initialized with the parameter @var{item}.
+A pointer to the newly added entry is returned.
@end deftypefun
As mentioned before the hashing table used by the functions described so
diff --git a/manual/signal.texi b/manual/signal.texi
index 59094023ad..903062f3c6 100644
--- a/manual/signal.texi
+++ b/manual/signal.texi
@@ -2561,6 +2561,12 @@ by modifying the signal mask.
The prototype for the @code{sigprocmask} function is in @file{signal.h}.
@pindex signal.h
+Note that you must not use @code{sigprocmask} in multi-threaded processes,
+because each thread has its own signal mask and there is no single process
+signal mask. According to POSIX, the behavior of @code{sigprocmask} in a
+multi-threaded process is ``unspeficied''. Instead, use
+@code{pthread_sigmask} (@pxref{Threads and Signal Handling}).
+
@comment signal.h
@comment POSIX.1
@deftypefun int sigprocmask (int @var{how}, const sigset_t *restrict @var{set}, sigset_t *restrict @var{oldset})