guile-devel
[Top][All Lists]
Advanced

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

scm_kill using raise


From: Kevin Ryde
Subject: scm_kill using raise
Date: Sun, 17 Dec 2006 11:08:01 +1100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

When there's no kill() function (eg. on mingw), scm_kill will use
raise() for the process itself (ie. pid==getpid()), but silently does
nothing for any other pid.

I think it should throw an error for that, so it doesn't look like the
operation succeeded when it didn't.  ENOSYS sounds right to me (and
exists on mingw).  An alternative would be ESRCH to claim the pid
doesn't exist, but that's not really true.


#define FUNC_NAME s_scm_kill
{
  /* Signal values are interned in scm_init_posix().  */
#ifdef HAVE_KILL
  if (kill (scm_to_int (pid), scm_to_int  (sig)) != 0)
    SCM_SYSERROR;
#else
  if (scm_to_int (pid) == getpid ())
    {
      if (raise (scm_to_int (sig)) != 0)
        {
        err:
          SCM_SYSERROR;
        }
      else
        {
          errno = ENOSYS;
          goto err;
        }
    }
#endif
  return SCM_UNSPECIFIED;
}




reply via email to

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