This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: restartable system calls under Linux
"Dale P. Smith" <dpsm@en.com> writes:
> Well, a simple read() seems to be restartable.
Here's the full definition of the current test:
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
])
Please try out a variant test based on `read'. If you feel
uncomfortable with the autoconf m4 stuff, just concentrate on the test
program itself, and I'll provide the rest.
That is, what I need is a test program which is sensitive to the
condition on your machine.