# psiginfo

## PROLOG



           This manual page is part of the POSIX Programmer's Manual.  The
           Linux implementation of this interface may differ (consult the
           corresponding Linux manual page for details of Linux behavior), or
           the interface may not be implemented on Linux.
    


## NAME



           psiginfo, psignal — write signal information to standard error
    


## SYNOPSIS



           #include <signal.h>
    
           void psiginfo(const siginfo_t *_pinfo_ , const char *_message_);
           void psignal(int _signum_ , const char *_message_);
    


## DESCRIPTION



           The _psiginfo_() and _psignal_() functions shall write a language-
           dependent message associated with a signal number to the standard
           error stream as follows:
    
            *  First, if _message_ is not a null pointer and is not the empty
               string, the string pointed to by the _message_ argument shall be
               written, followed by a <colon> and a <space>.
    
            *  Then the signal description string associated with _signum_ or
               with the signal indicated by _pinfo_ shall be written, followed
               by a <newline>.
    
           For _psiginfo_(), the application shall ensure that the argument
           _pinfo_ references a valid **siginfo_t** structure. For _psignal_(), if
           _signum_ is not a valid signal number, the behavior is
           implementation-defined.
    
           The _psiginfo_() and _psignal_() functions shall not change the
           orientation of the standard error stream.
    
           The _psiginfo_() and _psignal_() functions shall mark for update the
           last data modification and last file status change timestamps of
           the file associated with the standard error stream at some time
           between their successful completion and _exit_(), _abort_(), or the
           completion of _fflush_() or _fclose_() on _stderr_.
    
           The _psiginfo_() and _psignal_() functions shall not change the
           setting of _errno_ if successful.
    
           On error, the _psiginfo_() and _psignal_() functions shall set the
           error indicator for the stream to which _stderr_ points, and shall
           set _errno_ to indicate the error.
    
           Since no value is returned, an application wishing to check for
           error situations should set _errno_ to 0, then call _psiginfo_() or
           _psignal_(), then check _errno_.
    


## RETURN VALUE



           These functions shall not return a value.
    


## ERRORS



           Refer to fputc(3p).
    
           _The following sections are informative._
    


## EXAMPLES



           None.
    


## APPLICATION USAGE



           As an alternative to setting _errno_ to zero before the call and
           checking if it is non-zero afterwards, applications can use
           _ferror_() to detect whether _psiginfo_() or _psignal_() encountered an
           error.
    
           An application wishing to use this method to check for error
           situations should call _clearerr_(_stderr_) before calling _psiginfo_()
           or _psignal_(), then if _ferror_(_stderr_) returns non-zero, the value
           of _errno_ indicates which error occurred.
    


## RATIONALE



           System V historically has _psignal_() and _psiginfo_() in _< siginfo.h>_.
           However, the _< siginfo.h>_ header is not specified in the Base
           Definitions volume of POSIX.1‐2017, and the type **siginfo_t** is
           defined in _< signal.h>_.
    


## FUTURE DIRECTIONS



           None.
    


* * *