geterror Kernel Service

Purpose

Determines the completion status of the buffer.

Syntax

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

int geterror ( bp)
struct buf  *bp;

Parameter

Item Description
bp Specifies the address of the buffer structure whose status is to be checked.

On a platform that supports storage keys, the passed in bp parameter must be in the KKEY_PUBLIC or KKEY_BLOCK_DEV protection domain.

Description

The geterror kernel service checks the specified buffer to see if the b_error flag is set. If that flag is not set, the geterror service returns 0. Otherwise, it returns the nonzero B_ERROR value or the EIO value (if b_error is 0).

Execution Environment

The geterror kernel service can be called from either the process or interrupt environment.

Return Values

Item Description
0 Indicates that no I/O error occurred on the buffer.
b_error value Indicates that an I/O error occurred on the buffer.
EIO Indicates that an unknown I/O error occurred on the buffer.