]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* acspecific.m4 (AC_SYS_RESTARTABLE_SYSCALLS): Added some missing
authorAkim Demaille <akim@epita.fr>
Thu, 9 Mar 2000 15:44:40 +0000 (15:44 +0000)
committerAkim Demaille <akim@epita.fr>
Thu, 9 Mar 2000 15:44:40 +0000 (15:44 +0000)
headers if they exist (needed for some missing prototypes) and
corrects the signal handler prototype/definition.  The signal
handler prototype is now prepended with an `extern "C"' for C++
compilers since some platforms explicitly require an `extern "C"'
signal handler.

ChangeLog
THANKS
acspecific.m4
lib/autoconf/specific.m4

index b9f2e307c91dd0fac17cc1f0433f903fa7582d2e..0b7c2b70788e0b2402cf19120cb22fdec1735f49 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,19 @@
+2000-03-09  Ossama Othman  <ossama@debian.org>
+
+       * acspecific.m4 (AC_SYS_RESTARTABLE_SYSCALLS): Added some missing
+       headers if they exist (needed for some missing prototypes) and
+       corrects the signal handler prototype/definition.  The signal
+       handler prototype is now prepended with an `extern "C"' for C++
+       compilers since some platforms explicitly require an `extern "C"'
+       signal handler.
+
 2000-03-08  Akim Demaille  <akim@epita.fr>
 
        * autoheader.m4 (autoheader::AC_CHECK_HEADERS_DIRENT): Renamed as
        (autoheader::_AC_CHECK_HEADERS_DIRENT): to cope with the new name
        of the autoconf:: macro.
        Fixes autoconf/119, reported by Raja R Harinath.
-       
+
 2000-03-08  Akim Demaille  <akim@epita.fr>
 
        * acgeneral.m4 (AC_PATH_PROG, AC_OUTPUT_FILES, AC_OUTPUT_SUBDIRS):
diff --git a/THANKS b/THANKS
index 0d01f735e74587fbc4384f29aae47dbc097ed4f2..786a36fc70bf1d22ffd4b6279b7f740ed36f0b25 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -79,6 +79,7 @@ Miles Bader           miles@gnu.ai.mit.edu
 Nicolas Joly           njoly@pasteur.fr
 Noah Elliott           elliott@hera.llnl.gov
 Noah Friedman          friedman@gnu.ai.mit.edu
+Ossama Othman          ossama@debian.org
 Patrick Tullmann       tullmann@cs.utah.edu
 Paul Eggert            eggert@twinsun.com
 Paul Gampe             paulg@apnic.net
index de2e1f9b6b843836899f5134c66f1d861af963f7..8ee7493eb2b1aa7aad9d9725b00582859c067ab0 100644 (file)
@@ -3076,23 +3076,53 @@ fi
 
 # AC_SYS_RESTARTABLE_SYSCALLS
 # ---------------------------
+# If the system automatically restarts a system call that is
+# interrupted by a signal, define `HAVE_RESTARTABLE_SYSCALLS'.
 AC_DEFUN(AC_SYS_RESTARTABLE_SYSCALLS,
-[AC_CACHE_CHECK(for restartable system calls, ac_cv_sys_restartable_syscalls,
+[AC_REQUIRE([AC_HEADER_SYS_WAIT])dnl
+AC_CHECK_HEADERS(unistd.h)
+AC_CACHE_CHECK(for restartable system calls, ac_cv_sys_restartable_syscalls,
 [AC_TRY_RUN(
 [/* Exit 0 (true) if wait returns something other than -1,
    i.e. the pid of the child, which means that wait was restarted
    after getting the signal.  */
+
 #include <sys/types.h>
 #include <signal.h>
-ucatch (isig) { }
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+
+/* Some platforms explicitly require an extern "C" signal handler
+   when using C++. */
+#ifdef __cplusplus
+extern "C" void ucatch (int dummy) { }
+#else
+void ucatch (dummy) int dummy; { }
+#endif
+
 int
 main ()
 {
   int i = fork (), status;
-  if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); }
+
+  if (i == 0)
+    {
+      sleep (3);
+      kill (getppid (), SIGINT);
+      sleep (3);
+      exit (0);
+    }
+
   signal (SIGINT, ucatch);
-  status = wait(&i);
-  if (status == -1) wait(&i);
+
+  status = wait (&i);
+  if (status == -1)
+    wait (&i);
+
   exit (status == -1);
 }], ac_cv_sys_restartable_syscalls=yes, ac_cv_sys_restartable_syscalls=no)])
 if test $ac_cv_sys_restartable_syscalls = yes; then
index de2e1f9b6b843836899f5134c66f1d861af963f7..8ee7493eb2b1aa7aad9d9725b00582859c067ab0 100644 (file)
@@ -3076,23 +3076,53 @@ fi
 
 # AC_SYS_RESTARTABLE_SYSCALLS
 # ---------------------------
+# If the system automatically restarts a system call that is
+# interrupted by a signal, define `HAVE_RESTARTABLE_SYSCALLS'.
 AC_DEFUN(AC_SYS_RESTARTABLE_SYSCALLS,
-[AC_CACHE_CHECK(for restartable system calls, ac_cv_sys_restartable_syscalls,
+[AC_REQUIRE([AC_HEADER_SYS_WAIT])dnl
+AC_CHECK_HEADERS(unistd.h)
+AC_CACHE_CHECK(for restartable system calls, ac_cv_sys_restartable_syscalls,
 [AC_TRY_RUN(
 [/* Exit 0 (true) if wait returns something other than -1,
    i.e. the pid of the child, which means that wait was restarted
    after getting the signal.  */
+
 #include <sys/types.h>
 #include <signal.h>
-ucatch (isig) { }
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+
+/* Some platforms explicitly require an extern "C" signal handler
+   when using C++. */
+#ifdef __cplusplus
+extern "C" void ucatch (int dummy) { }
+#else
+void ucatch (dummy) int dummy; { }
+#endif
+
 int
 main ()
 {
   int i = fork (), status;
-  if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); }
+
+  if (i == 0)
+    {
+      sleep (3);
+      kill (getppid (), SIGINT);
+      sleep (3);
+      exit (0);
+    }
+
   signal (SIGINT, ucatch);
-  status = wait(&i);
-  if (status == -1) wait(&i);
+
+  status = wait (&i);
+  if (status == -1)
+    wait (&i);
+
   exit (status == -1);
 }], ac_cv_sys_restartable_syscalls=yes, ac_cv_sys_restartable_syscalls=no)])
 if test $ac_cv_sys_restartable_syscalls = yes; then