getuerror Kernel Service

Purpose

Allows kernel extensions to read the ut_error field for the current thread.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
int getuerror ()

Description

The getuerror kernel service allows a kernel extension in a process environment to retrieve the current value of the current thread's ut_error field. Kernel extensions can use the getuerror service when using system calls or other kernel services that return error information in the ut_error field.

For system calls, the system call handler copies the value of the ut_error field in the per thread uthread structure to the errno global variable before returning to the caller. However, when kernel services use available system calls, the system call handler is bypassed. The getuerror service must then be used to obtain error information.

Execution Environment

The getuerror kernel service can be called from the process environment only.

Return Values

Item Description
0 Indicates a successful operation.

When an error occurs, the getuerror kernel service returns the current value of the ut_error field in the per thread uthread structure. Possible return values for this field are defined in the /usr/include/sys/errno.h file.