home *** CD-ROM | disk | FTP | other *** search
- /* sys/raise.c (emx+gcc) -- Copyright (c) 1992-1993 by Eberhard Mattes */
-
- #include <sys/emx.h>
- #include <os2emx.h>
- #include <string.h>
- #include <signal.h>
- #include <errno.h>
- #include "syscalls.h"
- #include "syssig.h"
-
- int __raise (int sig)
- {
- ULONG rc;
- EXCEPTIONREPORTRECORD rep;
-
- if (sig < 1 || sig >= NSIG)
- {
- errno = EINVAL;
- return (-1);
- }
- if (_sys_sig_ack_req[sig])
- _sys_sig_pending[sig] = 1;
- else
- {
- _sys_sig_ack_req[sig] = 1;
- memset (&rep, 0, sizeof (rep));
- rep.ExceptionNum = SIG2X (sig);
- rc = DosRaiseException (&rep);
- if (rc != 0)
- {
- _sys_set_errno (rc);
- return (-1);
- }
- }
- return (0);
- }
-