home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / LIBSRC.ZOO / libsrc / local / kill.c < prev    next >
Text File  |  1992-03-08  |  692b  |  29 lines

  1. #define INCL_DOSSIGNALS
  2. #include <os2.h>
  3. #include <signal.h>
  4. #include <errno.h>
  5.  
  6. ULONG Dos32SendSignalException() asm ("Dos32SendSignalException");
  7. ULONG Dos32RaiseException() asm ("Dos32RaiseException");
  8.  
  9. int kill (pid_t pid, int sig)
  10. {ULONG rc;
  11.    EXCEPTIONREPORTRECORD ExceptRepRec;
  12.  
  13.    if (sig > NSIG || sig < 1)
  14.    {
  15.       errno = EINVAL;
  16.       return (-1);
  17.    }
  18.  
  19.    bzero (&ExceptRepRec, sizeof (EXCEPTIONREPORTRECORD));
  20.  
  21.    ExceptRepRec.ExceptionNum = XCPT_FATAL_EXCEPTION | XCPT_CUSTOMER_CODE | sig;
  22. /*   ExceptRepRec.ExceptionNum = XCPT_ILLEGAL_INSTRUCTION;*/
  23.  
  24.    rc = Dos32RaiseException ( &ExceptRepRec);
  25.  
  26. /*   Dos32SendSignalException (pid, 10);*/
  27. }
  28.  
  29.