+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):
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
# 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
# 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