NAME
|
errstr, rerrstr, werrstr – description of last system call error |
SYNOPSIS
|
#include <u.h> #include <libc.h> |
DESCRIPTION
|
When a system call fails it returns –1 and records a null terminated
string describing the error in a per–process buffer. Errstr swaps
the contents of that buffer with the contents of the array err.
Errstr will write at most nerr bytes into err; if the per–process
error string does not fit, it is silently truncated at a UTF
character boundary. The returned string is NUL–terminated. Usually
errstr will be called with an empty string, but the exchange property
provides a mechanism for libraries to set the return value for
the next call to errstr.
|
SOURCE
|
/sys/src/libc/9syscall /sys/src/libc/9sys/werrstr.c |
DIAGNOSTICS
|
Errstr always returns 0. |
SEE ALSO
|
intro(2), perror(2) |