about summary refs log tree commit diff
path: root/manual
diff options
context:
space:
mode:
Diffstat (limited to 'manual')
-rw-r--r--manual/Makefile17
-rw-r--r--manual/signal.texi24
-rw-r--r--manual/xtract-typefun.awk26
3 files changed, 66 insertions, 1 deletions
diff --git a/manual/Makefile b/manual/Makefile
index 0f525be731..0e8ae85dc7 100644
--- a/manual/Makefile
+++ b/manual/Makefile
@@ -21,6 +21,9 @@
 subdir := manual
 export subdir := $(subdir)
 
+# We need GNU awk for the xtract-typefun script.
+GAWK = gawk
+
 .PHONY: all dvi info
 all: dvi info
 dvi: libc.dvi
@@ -60,6 +63,17 @@ stamp-summary: summary.awk $(chapters) $(chapters-incl)
 # touch is broken on our machines.  Sigh.
 	date > $@
 
+# Generate a file which can be added to the `dir' content to provide direct
+# access to the documentation of the function, variables, and other
+# definitions.
+dir-add.texi: manual/xtract-typefun.awk $(chapters-incl)
+	if test -n "$(chapters-incl)"; then \
+	  (for i in $(chapters-incl); do \
+	     $(GAWK) -f $< < $i; \
+	   done) | sort > $@.new; \
+	   ./move-if-change $@.new $@; \
+	fi
+
 # Generate Texinfo files from the C source for the example programs.
 %.c.texi: examples/%.c
 	sed -e 's,[{}],@&,g'				\
@@ -78,7 +92,8 @@ distribute = $(minimal-dist)	       					\
 	     $(patsubst examples/%.c,%.c.texi,$(filter examples/%.c,	\
 			$(minimal-dist)))				\
 	     libc.info* libc.?? libc.??s texinfo.tex summary.texi	\
-	     stamp-summary chapters chapters-incl
+	     stamp-summary chapters chapters-incl			\
+	     xtract-typefun.awk
 export distribute := $(distribute)
 
 tar-it = tar chovf $@ $^
diff --git a/manual/signal.texi b/manual/signal.texi
index 1a4f866876..767ddabb41 100644
--- a/manual/signal.texi
+++ b/manual/signal.texi
@@ -1040,6 +1040,18 @@ a handler for @code{SIGKILL} or @code{SIGSTOP}.
 @end table
 @end deftypefun
 
+@strong{Compatibility Note:} A problem when working with the
+@code{signal} function is that it has a different semantic on BSD and
+SVID system.  The difference is that on SVID systems the signal handler
+is deinstalled after an signal was delivered.  On BSD systems the
+handler must be explicitly deinstalled.  In the GNU C Library we use the
+BSD version by default.  To use the SVID version you can either use the
+function @code{sysv_signal} (see below) or use the @code{_XOPEN_SOURCE}
+feature select macro (@pxref{Feature Test Macros})  Generally it should
+be avoided to use this functions due to the compatibility problems.  It
+is better to use @code{sigaction} if it is available since the results
+are much more reliable.
+
 Here is a simple example of setting up a handler to delete temporary
 files when certain fatal signals happen:
 
@@ -1080,6 +1092,18 @@ example because these are designed to provide information for debugging
 (a core dump), and the temporary files may give useful information.
 
 @comment signal.h
+@comment GNU
+@deftypefun sighandler_t sysv_signal (int @var{signum}, sighandler_t @var{action})
+The @code{sysv_signal} implements the behaviour of the standard
+@code{signal} function as found on SVID systems.  The difference to BSD
+systems is that the handler is deinstalled after a delivery of a signal.
+
+@strong{Compatibility Note:} As said above for @code{signal}, this
+function should be avoided when possible.  @code{sigaction} is the
+preferred method.
+@end deftypefun
+
+@comment signal.h
 @comment SVID
 @deftypefun sighandler_t ssignal (int @var{signum}, sighandler_t @var{action})
 The @code{ssignal} function does the same thing as @code{signal}; it is
diff --git a/manual/xtract-typefun.awk b/manual/xtract-typefun.awk
new file mode 100644
index 0000000000..6450ac10eb
--- /dev/null
+++ b/manual/xtract-typefun.awk
@@ -0,0 +1,26 @@
+#! /usr/local/bin/gawk -f
+BEGIN {
+  last_node="";
+}
+
+/^@node/ {
+  last_node = gensub (/@node +([^@,]+).*/, "\\1", 1);
+}
+
+/^@deftypefun/ {
+  printf ("* %s: (libc)%s.\n",
+	  gensub (/@deftypefun +([^{ ]+|\{[^}]+\}) +([[:alpha:]_][[:alnum:]_]+).*/, "\\2", 1),
+    last_node);
+}
+
+/^@deftypevr/ {
+  printf ("* %s: (libc)%s.\n",
+	  gensub (/@deftypevr +([^{ ]+|\{[^}]+\}) +([^{ ]+|\{[^}]+\}) +([[:alpha:]_][[:alnum:]_]+).*/, "\\3", 1),
+    last_node);
+}
+
+/^@deftypefn/ {
+  printf ("* %s: (libc)%s.\n",
+	  gensub (/@deftypefn +([^{ ]+|\{[^}]+\}) +[^{ ]*(\{[^}]+\})? +([[:alpha:]_][[:alnum:]_]+).*/, "\\3", 1),
+    last_node);
+}