#include "main.h" #include <stdio.h> #include <signal.h> //void (*signal(int sig, void (*func)(int)))(int) static void signal_handler(int signo) { printf("signal handler is "); } int main() { /** kill把信号发送给进程或进程组; raise把信号发送给(进程)自身. **/ int ret = -1; char buf[510] = {0}; signal(SIGILL,signal_handler); getchar(); ret = raise(SIGILL); // 自己给自己发信号 kill 向pid发信号 printf("ret is %d ",ret); //free(&ret); sprintf(buf, "_G711u"); printf("buf is %s ",buf); sprintf(buf, ".wav"); printf("buf is %s ",buf); while(1); return 0; }