Go to main content

man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

getxerror(9F)

Name

geterror, getxerror - returnI/Oerror information

Synopsis

#include <sys/types.h>
#include <sys/buf.h>
#include <sys/ddi.h>

int geterror(struct buf *bp);
b_xerror_t getxerror(struct buf *bp);

Interface Level

Architecture independent level 1 (DDI/DKI).

Parameters

bp

Pointer to a buf(9S) structure.

Description

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).

Return Values

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.

Context

The geterror() and getxerror() function calls can be called from user, interrupt, or kernel context.

See Also

buf(9S), bioerror(9F), bioxerror(9F), Intro(2)

Writing Device Drivers in Oracle Solaris 11.4