unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* scm_kill using raise
@ 2006-12-17  0:08 Kevin Ryde
  2006-12-31  9:58 ` Neil Jerram
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Ryde @ 2006-12-17  0:08 UTC (permalink / raw)
  Cc: Nils Durner

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;
}


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-31  9:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-17  0:08 scm_kill using raise Kevin Ryde
2006-12-31  9:58 ` Neil Jerram

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).