From:	SMTP%"MikeChen@fbcs.fujitsu.com" 24-NOV-1997 20:13:19.38
To:	"'ntdev@atria.com'" <ntdev@atria.com>
CC:	
Subj:	[ntdev] Send a signal to a process again

Return-Path: owner-ntdev@atria.com
Received: by arisia.gce.com (UCX V4.1-12C, OpenVMS V7.1 VAX);
	Mon, 24 Nov 1997 20:11:52 -0500
Received: from gw.atria.com (gw.atria.com [192.88.237.2]) by mercury.mv.net (8.8.8/mem-971025) with SMTP id SAA03448 for <everhart@arisia.gce.com>; Mon, 24 Nov 1997 18:22:27 -0500 (EST)
Received: by gw.atria.com id <NAA08064@gw.atria.com> Mon, 24 Nov 1997 13:42:03 -0500    
Received: from fujitsuI.fujitsu.com by gw.atria.com id <NAA08050@gw.atria.com> Mon, 24 Nov 1997 13:41:55 -0500    
Received: from exchange.fbcs.fujitsu.com ([133.164.160.87]) by fujitsuI.fujitsu.com (8.8.5/8.7.3) with SMTP id KAA24400 for <ntdev@atria.com>; Mon, 24 Nov 1997 10:41:20 -0800 (PST)
Received: by exchange.fbcs.fujitsu.com with SMTP (Microsoft Exchange Server Internet Mail Connector Version 4.0.994.63)
	id <01BCF8C5.4FEE14E0@exchange.fbcs.fujitsu.com>; Mon, 24 Nov 1997 10:39:59 -0800
Message-ID: <c=US%a=_%p=Fujitsu%l=FBCSUSA/POEXCH1/000A7C16@exchange.fbcs.fujitsu.com>
From: "Chen, Mike (Anaheim)" <MikeChen@fbcs.fujitsu.com>
To: "'ntdev@atria.com'" <ntdev@atria.com>
Subject: [ntdev] Send a signal to a process again
Date: Mon, 24 Nov 1997 10:37:34 -0800
X-Mailer:  Microsoft Exchange Server Internet Mail Connector Version 4.0.994.63
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: owner-ntdev@atria.com
Precedence: bulk


Hi, thanks to everyone who responses to this question.

Let me cut and paste the signal.h to here first. Actually, if you take a
look to VC++ 's include directory, it is there.


/***
*signal.h - defines signal values and routines
*
*	Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
*
*Purpose:
*	This file defines the signal values and declares the signal functions.
*	[ANSI/System V]
*
*       [Public]
*
****/

#if _MSC_VER > 1000
#pragma once
#endif

#ifndef _INC_SIGNAL
#define _INC_SIGNAL

#if !defined(_WIN32) && !defined(_MAC)
#error ERROR: Only Mac or Win32 targets supported!
#endif


#ifdef __cplusplus
extern "C" {
#endif


/* Define _CRTAPI1 (for compatibility with the NT SDK) */

#ifndef _CRTAPI1
#if	_MSC_VER >= 800 && _M_IX86 >= 300
#define _CRTAPI1 __cdecl
#else
#define _CRTAPI1
#endif
#endif


/* Define _CRTAPI2 (for compatibility with the NT SDK) */

#ifndef _CRTAPI2
#if	_MSC_VER >= 800 && _M_IX86 >= 300
#define _CRTAPI2 __cdecl
#else
#define _CRTAPI2
#endif
#endif


/* Define _CRTIMP */

#ifndef _CRTIMP
#ifdef	_NTSDK
/* definition compatible with NT SDK */
#define _CRTIMP
#else	/* ndef _NTSDK */
/* current definition */
#ifdef	_DLL
#define _CRTIMP __declspec(dllimport)
#else	/* ndef _DLL */
#define _CRTIMP
#endif	/* _DLL */
#endif	/* _NTSDK */
#endif	/* _CRTIMP */


/* Define __cdecl for non-Microsoft compilers */

#if	( !defined(_MSC_VER) && !defined(__cdecl) )
#define __cdecl
#endif


#ifndef _SIG_ATOMIC_T_DEFINED
typedef int sig_atomic_t;
#define _SIG_ATOMIC_T_DEFINED
#endif


#define NSIG 23     /* maximum signal number + 1 */


/* Signal types */

#define SIGINT		2	/* interrupt */
#define SIGILL		4	/* illegal instruction - invalid function image */
#define SIGFPE		8	/* floating point exception */
#define SIGSEGV 	11	/* segment violation */
#define SIGTERM 	15	/* Software termination signal from kill */
#define SIGBREAK	21	/* Ctrl-Break sequence */
#define SIGABRT 	22	/* abnormal termination triggered by abort call */


/* signal action codes */

#define SIG_DFL (void (__cdecl *)(int))0	   /* default signal action */
#define SIG_IGN (void (__cdecl *)(int))1	   /* ignore signal */
#define SIG_SGE (void (__cdecl *)(int))3	   /* signal gets error */
#define SIG_ACK (void (__cdecl *)(int))4	   /* acknowledge */


/* signal error value (returned by signal call on error) */

#define SIG_ERR (void (__cdecl *)(int))-1	   /* signal error value */


/* pointer to exception information pointers structure */

#if defined(_MT) || defined(_DLL)
extern void * * __cdecl __pxcptinfoptrs(void);
#define _pxcptinfoptrs	(*__pxcptinfoptrs())
#else	/* ndef _MT && ndef _DLL */
extern void * _pxcptinfoptrs;
#endif	/* _MT || _DLL */


/* Function prototypes */

_CRTIMP void (__cdecl * __cdecl signal(int, void (__cdecl
*)(int)))(int);
_CRTIMP int __cdecl raise(int);


#ifdef __cplusplus
}
#endif

#endif	/* _INC_SIGNAL */

********************* End of Signal.h ************************




You can see they pre-defined some signals. Also, in the signal()
function, you can specify the signal and the corresponding handler. If
you have been working in Unix, you would know exactly what I am talking
about.

Since my code is ported from Unix, and it has these kinds of signal
handling functions. Of course, I can use all those message functions to
achieve this. But my goal is not changing that much. So I just want to
see whether there is a substitution for kill().

Also, I believe signal() is implemented by message function underneath.
But do you know what message type it is using ? Like 
SIGINT, SIGILL	,SIGFPE	, SIGSEGV , SIGTERM , SIGBREAK, I believe there
should be a window message corresponding to them.

Thanks again.

Mike



 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[ To unsubscribe, send email to ntdev-request@atria.com with body
UNSUBSCRIBE (the subject is ignored). ]
