henesyinit from p9fd787fda5 years agoHistory
75 lines · 1.5 KB · Text
RawDownload
.TH ERRSTR 2.SH NAMEerrstr, rerrstr, werrstr \- description of last system call error.SH SYNOPSIS.B #include <u.h>.br.B #include <libc.h>.PP.Bint errstr(char *err, uint nerr).PP.Bvoid rerrstr(char *err, uint nerr).PP.Bvoid werrstr(char *fmt, ...).SH DESCRIPTIONWhen a system call fails it returns \-1 andrecords a string describing the error in a per-process buffer..I Errstrswaps the contents of that buffer with the contents of the array.IR err ..I Errstrwill write at most .I nerrbytes into .IR 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.I errstrwill be called with an empty string,but the exchange property provides a mechanism forlibraries to set the return value for the next call to.IR errstr ..PPIf no system call has generated an error since the last call to.I errstrwith an empty string,the result is an empty string..PPThe verb.B rin.IR print (2)calls.I errstrand outputs the error string..PP.I Rerrstrreads the error string but does not modify the per-process buffer, soa subsequent.I errstrwill recover the same string..PP.I Werrstrtakes a.I printstyle format as its argument and uses it to formata string to pass to.IR errstr .The string returned from.I errstris discarded..SH SOURCE.B /sys/src/libc/9syscall.br.B /sys/src/libc/9sys/werrstr.c.SH DIAGNOSTICS.I Errstralways returns 0..SH SEE ALSO.IR intro (2),.IR perror (2)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t