[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guile-1.8.1 - problems on AMD64

From: Neil Jerram
Subject: Re: guile-1.8.1 - problems on AMD64
Date: Thu, 19 Oct 2006 19:46:24 +0100
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> I guess the point of this `_FORTIFY_SOURCE' thing is to help catch
> errors related to interactions with the kernel (among others).  The idea
> is that when performing a system call, one _should_ be concerned about
> its result.
> In the case of async.c:250, I don't understand whether/how failure of
> the `write ()' call should be handled.

I think it's writing a byte as an inter-thread signaling mechanism.
It's pretty unlikely that a single byte write will be interrupted, but
if it is then a retry will be needed, so I think the use of
SCM_SYSCALL is correct in principle here.

How about this, which is more similarly to the other uses of
SCM_SYSCALL in the code?

      SCM_SYSCALL (rv = write (sleep_fd, &dummy, 1));

(Whole patch is below.)


Index: async.c
RCS file: /cvsroot/guile/guile/guile-core/libguile/async.c,v
retrieving revision 1.86
diff -u -r1.86 async.c
--- async.c     17 Apr 2006 00:05:37 -0000      1.86
+++ async.c     19 Oct 2006 18:46:32 -0000
@@ -241,13 +241,14 @@
   if (sleep_fd >= 0)
       char dummy = 0;
+      int rv;
       /* Likewise, T might already been done with sleeping here, but
         interrupting it once too often does no harm.  T might also
         not yet have started sleeping, but this is no problem either
         since the data written to a pipe will not be lost, unlike a
         condition variable signal.
-      write (sleep_fd, &dummy, 1);
+      SCM_SYSCALL (rv = write (sleep_fd, &dummy, 1));
   /* This is needed to protect sleep_mutex.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]