O nás     Inzerce     KontaktSpolehlivé informace o IT již od roku 2011
Hledat
Nepřehlédněte: Usnadní vám práci: Pozoruhodné IT produkty pro rok 2024
Správa dokumentů
Digitální transformace
Informační systémy
Hlavní rubriky: Informační systémy, Mobilní technologie, Datová centra, Sítě, IT bezpečnost, Software, Hardware, Zkušenosti a názory, Speciály

Pozoruhodné IT produkty 2024
E-knihy o IT zdarma
Manuál Linux
[Linux manuál]

strerror, strerror_r: návratový řetězec popisující kód chyby

Originální popis anglicky: strerror, strerror_r - return string describing error code

Návod, kniha: Linux Programmer's Manual

STRUČNĚ

#include <string.h>
 
char *strerror(int errnum);
 
int strerror_r(int errnum, char *buf, size_t n);

POPIS / INSTRUKCE

The strerror() function returns a string describing the error code passed in the argument errnum, possibly using the LC_MESSAGES part of the current locale to select the appropriate language. This string must not be modified by the application, but may be modified by a subsequent call to perror() or strerror(). No library function will modify this string.
 
The strerror_r() function is similar to strerror(), but is thread safe. It returns the string in the user-supplied buffer buf of length n.
 

NÁVRATOVÁ HODNOTA

The strerror() function returns the appropriate error description string, or an unknown error message if the error code is unknown. The value of errno is not changed for a successful call, and is set to a nonzero value upon error. The strerror_r() function returns 0 on success and -1 on failure, setting errno.
 

CHYBY / ERRORY

EINVAL
The value of errnum is not a valid error number.
ERANGE
Insufficient storage was supplied to contain the error description string.
 

ODPOVÍDAJÍCÍ

SVID 3, POSIX, BSD 4.3, ISO/IEC 9899:1990 (C89).
 
strerror_r() with prototype as given above is specified by SUSv3, and was in use under Digital Unix and HP Unix. An incompatible function, with prototype
 
char *strerror_r(int errnum, char *buf, size_t n);
 
is a GNU extension used by glibc (since 2.0), and must be regarded as obsolete in view of SUSv3. The GNU version may, but need not, use the user-supplied buffer. If it does, the result may be truncated in case the supplied buffer is too small. The result is always NUL-terminated.

SOUVISEJÍCÍ

errno(3), perror(3), strsignal(3)
2001-10-16
©2011-2024 BusinessIT.cz, ISSN 1805-0522 | Názvy použité v textech mohou být ochrannými známkami příslušných vlastníků.
Provozovatel: Bispiral, s.r.o., kontakt: BusinessIT(at)Bispiral.com | Inzerce: Best Online Media, s.r.o., zuzana@online-media.cz
O vydavateli | Pravidla webu BusinessIT.cz a ochrana soukromí | Používáme účetní program Money S3 | pg(8317)