[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AC_SYS_RESTARTABLE_SYSCALLS
From: |
David Oleszkiewicz |
Subject: |
AC_SYS_RESTARTABLE_SYSCALLS |
Date: |
Mon, 1 Oct 2001 23:24:15 -0700 (PDT) |
This is my first time using autoconf and i am a little confused with the
docs on this option.
The documentation states:
AC_SYS_RESTARTABLE_SYSCALLS
If the system automatically restarts a system call that is interrupted
by a signal, define HAVE_RESTARTABLE_SYSCALLS.
the macro, so you needn't go find it is:
AC_DEFUN(AC_SYS_RESTARTABLE_SYSCALLS,
[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) { }
main () {
int i = fork (), status;
if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0);
}
signal (SIGINT, ucatch);
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_DEFINE(HAVE_RESTARTABLE_SYSCALLS)
fi
])
which would seem to indicate that if the system automatically does not
restart system calls but rather wait() returns -1 (and presumably sets
errno to ERESTARTSYS or EINTR) the test would exit successfully meaning
no_default_restartable_syscall.
This result having no indication of whether the system is _able_ to
support automatically restarting system calls.
what am i missing.
thanks
dave
- AC_SYS_RESTARTABLE_SYSCALLS,
David Oleszkiewicz <=