I know that the signal handler cannot be inherited when call execv in the child process of fork, so I wonder if the execv process can be piped to communicate with the parent process. As far as I know, pipe communication requires parenthood or a common ancestor. But I don't know if the pipe mechanism still works in execv.
Here's what I'm trying to do: Contains an breakpoint signal in the target program execv will execute.Is it possible that I want to be able to tell the parent process this message when a breakpoint is triggered? What can I do with it?
I'm not sure if I fully understand your question, but I think you're trying to set up signal handlers in the child process, then call
execv, with your signals handlers still ready ?You can't. Upon calling
execv, the calling process is replaced by the executed program. Your file descriptor manipulation are preserved by default, so you can pipe stdout or stderr to wherever you want(file, parent stdin, ...) but everything else is wiped.EDIT: So read the history of your question (why did you edited it ? I was much clearer, imo). But you should take a look at the
ptracesyscall (on linux, don't know the equivalent on windows)