geterror, getxerror - returnI/Oerror information
#include <sys/types.h> #include <sys/buf.h> #include <sys/ddi.h> int geterror(struct buf *bp); b_xerror_t getxerror(struct buf *bp);
Architecture independent level 1 (DDI/DKI).
Pointer to a buf(9S) structure.
The geterror() function returns the error number from the b_error field of the buf(9S) buffer header structure. This value is typically set by device driver use of bioerror(9F) or bioxerror(9F).
The getxerror() function returns the extended error from the b_xerror field of the buf(9S) buffer header structure. This value is typically set by a device driver use of bioxerror(9F).
For geterror(), an Intro(2) system call error number indicating the error condition of the I/O request is returned. If the I/O request completes successfully, 0 is returned.
For getxerror(), the extended error value of the I/O request is returned. If geterror() indicates that the I/O request failed, and no driver established an extended error via bioxerror(9F), B_XERR_UNDEFINED is returned. If geterror() indicates that the I/O request succeeded, getxerror() may return B_XERR_RECOVERED if driver error recovery operations were necessary for success.
The geterror() and getxerror() function calls can be called from user, interrupt, or kernel context.