Explain how the sigpending function is used to examine pending signals in a process. Provide an example that checks if SIGINT is pending and prints a message accordingly.
The sigpending function allows a process to inspect its pending signals. This can be useful for debugging or for applications that need to know which signals have been received while they were blocked. For e.g:-