#How to ignore SIGCHLD signal in Rust??
8 messages · Page 1 of 1 (latest)
SIGCHLD is Ignored by default btw.
You can use the signal_hook crate's signal_hook::low_level::register to register an arbitrary handler (with note that you must uphold the safety requirements yourself, since it's an unsafe fn)
If you really want to, you can also use libc::sigaction to directly call the C library.
which I guess you may need to since explicitly SIG_IGNing SIGCHLD does something different than the default ignoring https://stackoverflow.com/questions/40601337/what-is-the-use-of-ignoring-sigchld-signal-with-sigaction2
i want to achieve same behavior like with "signal(SIGCHLD, SIG_IGN);" but i want safe way if possible
Yes, that's what I said in my second message where I linked that exact stackexchange post.
There's unlikely to be a way without unsafe, much to do with signals is inherently unsafe
hmm so whats better, using native signal function or signal_hook