The question is simple- is it possible to write the program, that:
/bin/bash
; not a function), and waits until it ends and
SIGINT
or SIGSEGV
signals sent to the subprogram? First is easy. Second is "maybe", depends on what do you want exactly. ptrace()
system call may help. Using ptrace is not what most people want on daily bases, but it may suite you.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.