plan9 man page for errstr

Query: errstr

OS: plan9

Section: 2

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

ERRSTR(2)							System Calls Manual							 ERRSTR(2)

NAME
errstr, werrstr - description of last system call error
SYNOPSIS
#include <u.h> #include <libc.h> int errstr(char *err) void werrstr(char *fmt, ...)
DESCRIPTION
When a system call fails it returns -1 and records a string describing the error in a per-process buffer. Errstr swaps the contents of that buffer with the contents of the array err. Err should contain at least ERRLEN characters (defined in <libc.h>). 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. If no system call has generated an error since the last call to errstr with an empty string, the result is an empty string. The verb r in print(2) calls errstr and outputs the error string. Werrstr takes a print style format as its argument and uses it to format a string to pass to errstr. The string returned from errstr is discarded.
SOURCE
/sys/src/libc/9syscall /sys/src/libc/9sys/werrstr.c
DIAGNOSTICS
Errstr always returns 0.
SEE ALSO
intro(2), perror(2) ERRSTR(2)
Related Man Pages
errstr(2) - plan9
bsde_parse_rule(3) - freebsd
bsde_delete_rule(3) - freebsd
bsde_get_rule(3) - freebsd
bsde_add_rule(3) - freebsd
Similar Topics in the Unix Linux Community
Solaris 10 Sendemail with Attachment
Check data in mysql
Finding SSL Cert Info
Perl inserting random negative integer
IP list specific port checker script