Unix/Linux Go Back    

Plan 9 - man page for errstr (plan9 section 2)

Linux & Unix Commands - Search Man Pages
Man Page or Keyword Search:   man
Select Man Page Set:       apropos Keyword Search (sections above)

ERRSTR(2)										ERRSTR(2)

       errstr, werrstr - description of last system call error

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

       int errstr(char *err)

       void werrstr(char *fmt, ...)

       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.


       Errstr always returns 0.

       intro(2), perror(2)

Unix & Linux Commands & Man Pages : ©2000 - 2018 Unix and Linux Forums

All times are GMT -4. The time now is 11:37 PM.