assert_perror (3) Linux Manual Page
assert_perror – test errnum and abort
Synopsis
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <assert.h>
void assert_perror(int errnum);
Description
If the macro NDEBUG was defined at the moment <assert.h> was last included, the macro assert_perror() generates no code, and hence does nothing at all. Otherwise, the macro assert_perror() prints an error message to standard error and terminates the program by calling abort(3) if errnum is nonzero. The message contains the filename, function name and line number of the macro call, and the output of strerror(errnum).Return Value
No value is returned.Attributes
For an explanation of the terms used in this section, see attributes(7).| Interface | Attribute | Value |
| assert_perror() | Thread safety | MT-Safe |
