[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Kernel and Subsystems, Volume 1

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

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.

Related Information

The setuerror kernel service.

Kernel Extension and Device Driver Management Kernel Services and Understanding System Call Execution in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]