errstr man page on Plan9

Man page or keyword search:  
man Server   549 pages
apropos Keyword Search (all sections)
Output format
Plan9 logo
[printable version]

ERRSTR(2)							     ERRSTR(2)

NAME
       errstr, rerrstr, werrstr - description of last system call error

SYNOPSIS
       #include <u.h>
       #include <libc.h>

       int errstr(char *err, uint nerr)

       void rerrstr(char *err, uint nerr)

       void werrstr(char *fmt, ...)

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.

       The per-process buffer is ERRMAX bytes long.  Any error string provided
       by  the user will be truncated at ERRMAX-1 bytes.  ERRMAX is defined in
       <libc.h>.

       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.

       Rerrstr reads the error string but does not modify the per-process buf‐
       fer, so a subsequent errstr will recover the same string.

       Werrstr takes a print style format as its argument and uses it to  for‐
       mat  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)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Plan9

List of man pages available for Plan9

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net