signal raise alarm用法
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
void signalHangle(int signo){
printf("signo = %d\n", signo);
switch (signo) {
case SIGSTOP:
printf("STOP!\n");
break;
case SIGTSTP:
printf("TSTP!\n");
raise(SIGSTOP);
//raise(SIGCONT);
break;
case SIGCONT:
printf("SIGCONT!\n");
break;
case SIGKILL:
printf("SIGKILL!\n");
break;
case SIGINT:
printf("SIGKILL!\n");
break;
case SIGTERM:
printf("SIGTERM!\n");
break;
default:
break;
}
}
int main(int argc, char** argv){
signal(SIGTSTP, signalHangle);
//signal(SIGSTOP, signalHangle);
//signal(SIGCONT, signalHangle);
signal(SIGALRM, signalHangle);
signal(SIGKILL, signalHangle);
signal(SIGINT, signalHangle);
signal(SIGTERM, signalHangle);
alarm(1);
while (1) {
pause();
//sleep(1);
printf("Hello signal handler! pid = %d\n", getpid());
//raise(SIGTSTP);
//alarm(1);
//sleep(3);
//raise(SIGALRM);
}
return 0;
}
相關文章
- Linux alarm signal (SIGALRM) to detach process isAliveLinux
- raise()AI
- arise、rise、raise、arouseAI
- Oracle 中的exception——(Raise)OracleExceptionAI
- RAISE_APPLICATION_ERRORAIAPPError
- Oracle中RAISE異常OracleAI
- Service Alarm Platform 介紹Platform
- alarm() (鬧鐘函式)函式
- Android Framework : Alarm 機制AndroidFramework
- Linux下開發-alarmLinux
- Linux 定時器alarm()Linux定時器
- signal協議協議
- golang處理signalGolang
- Linux Signal 示例Linux
- mysqld got signal 8MySqlGo
- python自定義異常,使用raise引發異常PythonAI
- os/signal學習筆記筆記
- python 之訊號SignalPython
- wifi管理神器:WiFi Signal MacWiFiMac
- <摘錄>linux signal 列表Linux
- Linux 下 signal 機制Linux
- Raise Server-Side Click Event of CheckBox in a DataGrid Template ColumnAIServerIDE
- 鬧鐘和時間管理工具:Alarm Clock Pro for macMac
- Signal:更多前端框架的選擇前端框架
- linux signal函式詳解Linux函式
- The Secret Mixed-Signal Life of PWM Peripherals
- (slave不停restart)mysqld got signal 11RESTMySqlGo
- Linux訊號(signal)機制Linux
- 一個可擴充套件的報警系統Quick-Alarm套件UI
- C語言alarm()函式:設定訊號傳送鬧鐘C語言函式
- iOS Mach異常和signal訊號iOSMac
- 每週一個 Python 模組 | signalPython
- MetricMeasurement calculates Peak Signal-to-Noise RatioREM
- AQS相關(lock、unlock、await、signal)AQSAI
- inux程式設計下signal()函式UX程式設計函式
- signal(SIGPIPE, SIG_IGN)
- Qt的Signal和Slot機制(二)QT
- 【MySQL】mysqld got signal 11 案例一則MySqlGo