win32 signal
The signal function enables a process to choose one of several ways to handle an interrupt signal from the operating system. The sig argument is the interrupt to which signal responds; it must be one of the following manifest constants, which are defined in SIGNAL.H.
|
sig value |
Description |
|---|---|
|
SIGABRT |
Abnormal termination |
|
SIGFPE |
Floating-point error |
|
SIGILL |
Illegal instruction |
|
SIGINT |
CTRL+C signal |
|
SIGSEGV |
Illegal storage access |
|
SIGTERM |
Termination request |
If sig is not one of the above values, the invalid parameter handler is invoked, as defined in Parameter Validation . If execution is allowed to continue, this function sets errno to EINVALand returns SIG_ERR.
By default, signal terminates the calling program with exit code 3, regardless of the value of sig.
Example :
int main(void)
{ typedef void (*SignalHandlerPointer)(int); SignalHandlerPointer previousHandler;
previousHandler = signal(SIGABRT, SignalHandler);
previousHandler = signal(SIGINT, SignalHandler);
previousHandler = signal(SIGTERM, SignalHandler);
previousHandler = signal(SIGBREAK, SignalHandler); //abort();
while ()
{
Sleep();
}
void SignalHandler(int signal)
{
if (signal == SIGABRT)
{
// abort signal handler code
} else
{
// ...
} printf("____ signal: %d \n", signal);
}
http://msdn.microsoft.com/en-us/library/xdkz3x12.aspx
Send signal
win32 signal的更多相关文章
- 转:RTMPDump源代码分析
0: 主要函数调用分析 rtmpdump 是一个用来处理 RTMP 流媒体的开源工具包,支持 rtmp://, rtmpt://, rtmpe://, rtmpte://, and rtmps://. ...
- rtmpdump代码分析 转
RTMPdump 源代码分析 1: main()函数 rtmpdump 是一个用来处理 RTMP 流媒体的工具包,支持 rtmp://, rtmpt://, rtmpe://, rtmpte://, ...
- rpcz VC2010 构建
rpcz VC2010 构建 rpcz 是应用ZeroMQ和Protobuf开发的RPC. 见: https://github.com/reinferio/rpcz 及 https://code.go ...
- 【PHP源码】PHP 函数调用
title: [PHP 源码]PHP 函数调用 date: 2020-03-30 23:25:00 updated: 2020-04-04 19:57:00 tags: PHP 源码 想法 我以前对于 ...
- multiprocessing 让子进程忽略信号,手动关闭子进程
起因 同事想要写一个代码,主进程中监听SIGINT.SIGTERM信号退出,并关闭启动的子进程,代码类似这样 import signal import sys import time from mul ...
- Serial Port Programming using Win32 API(转载)
In this tutorial we will learn How to communicate with an external device like a microcontroller boa ...
- Microsoft Win32 to Microsoft .NET Framework API Map
Microsoft Win32 to Microsoft .NET Framework API Map .NET Development (General) Technical Articles ...
- python signal信号
作用:发送和接收异步系统信号 信号是一个操作系统特性,它提供了一个途径可以通知程序发生了一个事件并异步处理这个事件.信号可以由系统本身生成,也可以从一个进程发送到另一个进程. 由于信号会中断程序的正常 ...
- python signal(信号)
信号的概念 信号(signal)-- 进程之间通讯的方式,是一种软件中断.一个进程一旦接收到信号就会打断原来的程序执行流程来处理信号. 几个常用信号: SIGINT 终止进程 中断进 ...
随机推荐
- TeamViewer 软件完全卸载
TeamViewer 软件似乎用于商业环境中 - 彻底卸载 Windows 1. 检测为商业用途该软件似乎用于商业环境中.请注意:免费版仅供个人使用.您的会话将在 5 分钟后终止. 2.1 Close ...
- 使用ActiveMQ 传输文件 以及使用Jetty搭建内嵌文件服务器
使用Active发送文件 ActiveMq 本身提供对于传输文件的支持. 1. 直接传输文件: 使用connection.createOutputStream 的形式.这种方式适合小文件.不能传输大文 ...
- Spring Boot入门程序
创建第一个Spring Boot的入门程序. 带你一步一步的,搭建第一个Spring Boot 的入门程序,并成功运行,通过实践过程,初步认识和了解如何使用Spring Boot 创建应用程序. 一. ...
- Linux教程之:Nginx [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
Nginx [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use) 使用命令关闭占用80端口的程序 sudo fuser - ...
- API:access_token
access_token存在意义: 1.身份验证(一个channel_id一般有0个或1个有效的access_token) 2.限制用户访问服务器数据的有效期 3.限制用户访问权限 access_ ...
- Cygwin Run in the Windows(Simulation of UNIX)
Preface Environment Cygwin Run in the Windows(Simulation of UNIX) Resource Cygwin Install:http://cyg ...
- *1 Two Sum two pointers(hashmap one scan)
Given an array of integers, return indices of the two numbers such that they add up to a specific ta ...
- chromedp自动启动为headless模式
// Command click is a chromedp example demonstrating how to use a selector to // click on an element ...
- IOS 4个容易混淆的属性(textAligment contentVerticalAlignment contentHorizontalAlignment contentMode)
四个容易混淆的属性:1. textAligment : 文字的水平方向的对齐方式1> 取值NSTextAlignmentLeft = 0, // 左对齐NSTextAlignme ...
- web的攻击技术
简单的http协议本身并不存在安全性问题,因此技术本身几乎不会成为攻击的对象,应用http协议的服务器和客户端,以及运行在服务器端web应用等资源才是攻击目标,那么怎么攻击,来源于哪里呢 web应用攻 ...