ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,everyone, can somebody help me to solve the problem?
i be requested to sent out two ways pipe, and the signal is sending through the pipe, so what can i do?? HERE is my current coding:-
Your message appears to have been cut off. You were just about to say what you expect the code to do and what it actually does and what you heave done to debug the problem.
Upon receiving a signal, you can send a message through the pipe (you could do that in a signal handler); upon which the process on the other end acts:
As smallpond said: signals are sent to processes. A pipe is not a process, and as such, you cannot send a signal through a pipe... try to visualize it ;-)
But the sender can send a message which the listener has to interpret, so it acts like you wanted.
In pseudo code:
Ramurd, i try it, but it doesn't work....since now i dealing with parent and child process...the scenario likes this, a pipe will be establish between the parent and child, and the signal should be able to send through the pipe from parent and child...
well; it's not that hard. If it's a real parent/child process, so the child is forked off the parent, you could use IPC calls as well...
You might want to read up on signals: what happens if a signal gets sent to the parent, what signal does the child get? Just remember: a pipe is an I/O stream, and you cannot send signals to that... you'll have to write a signal handler if what you want to happen on a certain signal is different from the default.
What process are you trying to send and catch? What code do you have?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.