I want to query Linux for all Traps that are defined, much like the "trap" command. Anyone know of a library for this? Would rather avoid using the "trap" command itself if possible.
thanks
I want to query Linux for all Traps that are defined, much like the "trap" command. Anyone know of a library for this? Would rather avoid using the "trap" command itself if possible.
thanks
the nix crate, specifically nix::sys::signal::Signal::iterator()
might offer the functionality you want
(though, thinking of it, trap
is a shell built-in not a separate binary, your program cannot learn the trap settings of the parent shell)
If you mean signals, then:
kill -l
. These don't change that often if at all, they don't differ one linux to another.signal
with that specific number will return an error if it isn't available.But maybe explain better what exactly you want to do, because the question is not very clear.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.