I am trying to overwrite or change the Signals of a process. As I guess there is a table of signals in every process separately.
Is there anything like that in the /proc folder?
Thank you for your time.
/proc/<pid>/status includes fields describing the given process’ signal handling; see man 5 proc for details. For example:
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000010000
SigIgn: 0000000000384004
SigCgt: 000000004b813efb
Signal handling can’t be changed externally, you can’t use this to affect a process’ signal handling.
If you can ptrace a process, you can attach a debugger to it and use this to change its signal handling.
Yes, read "NOTES" section in man 7 signal:
The
/proc/[pid]/task/[tid]/statusfile contains various fields that show the signals that a thread is blocking (SigBlk), catching (SigCgt), or ignoring (SigIgn). (The set of signals that are caught or ignored will be the same across all threads in a process.) Other fields show the set of pending signals that are directed to the thread (SigPnd) as well as the set of pending signals that are directed to the process as a whole (ShdPnd). The corresponding fields in/proc/[pid]/statusshow the information for the main thread. Seeproc(5)for further details.