Go to main content

man pages section 3: Basic Library Functions

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

strerrordesc_np(3C)

Name

strerrordesc_np, strerrorname_np - get error name and message strings

Synopsis

#include <string.h>

const char *strerrordesc_np(int errnum);
const char *strerrorname_np(int errnum);

Description

The strerrordesc_np() function maps the error number in errnum to the corresponding error message string. It differs from the standard strerror() function in 2 respects: The returned string is not translated according to the current locale, and strerrordesc_np() returns a NULL result for unknown error codes, rather than a generated descriptive string. See strerror(3C).

The strerrorname_np() function maps the error number in errnum to the corresponding error name. For example, given EPERM, strerrorname_np() returns a pointer to the string "EPERM".

Return Values

Upon successful completion, strerrordesc_np() returns a pointer to the error message string. It returns NULL if errnum is not a valid error number.

Upon successful completion, strerrorname_np() returns a pointer to the error name string. It returns NULL if errnum is not a valid error number.

Usage

The strings returned from these functions are not localized, and are unaffected by the native language specified by the LC_MESSAGES locale category.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
Safe
Standard
None

See Also

Intro(2), perror(3C), strerror(3C)

History

The strerrordesc_np() and strerrorname_np() functions were defined in GNU glibc 2.32, and were added to Oracle Solaris in the Oracle Solaris 11.4.30 release.