简体   繁体   English

信号发送字符串到子进程

[英]Signal to send string to child process

For my assignment I'm given the question to have a parent process send "user inputted" lines of text VIA signal to the child and have it print out the line of text. 对于我的作业,我想到一个问题,让父进程将“用户输入的”文本行通过VIA信号发送给孩子,并使其打印出文本行。

I'm seriously confused. 我很困惑。 I've read the whole chapter in my book on signals and it seems for the most part they are only used for termination, pauses, alerts. 我已经阅读了我的书中有关信号的整章内容,并且在大多数情况下,它们似乎仅用于终止,暂停和警报。 I originally thought through the alerts I could do that, But I'm honestly unsure. 我本来以为通过警报可以做到这一点,但老实说我不确定。 Is there a way to pass data through signals. 有没有一种方法可以通过信号传递数据。

POSIX signals (what we call signals in UNIX speak), are just events, so the only data you are sending is that it happened. POSIX信号(在UNIX中,我们称信号为信号)只是事件,所以您发送的唯一数据就是它发生了。 This does of course not prevent people from talking about signals in other contexts or with different meanings... 当然,这并不妨碍人们在其他情况下或具有不同含义的情况下谈论信号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM