如何从一个程序向另一个程序发送信号? [英] how to send signal from one program to another?

查看:62
本文介绍了如何从一个程序向另一个程序发送信号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用消息队列作为2个程序之间的ipc.现在,我想使用消息队列将数据从一个程序发送到另一个程序,然后通过信号SIGINT对其进行提示.

i am using message queue as an ipc between 2 programs. Now i want to send data from one program to another using message queue and then intimate it through a signal SIGINT.

我不知道如何从一个程序向另一个程序发送信号.如果有解决方案,任何人都可以提供示例代码.

I dont know how to send a signal from one program to another . Can anybody pls provide a sample code if they have the solution.

推荐答案

#include <sys/types.h>
#include <signal.h>
int kill(pid_t pid, int sig);

这篇关于如何从一个程序向另一个程序发送信号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆