[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

copyin64 Kernel Service

Purpose

Copies data between user and kernel memory.

Syntax

#include <sys/types.h>
#include <sys/ernno.h>
#include <sys/uio.h>

int copyin64 (uaddr64, kaddr, count);
unsigned long long uaddr64;
char * kaddr;
int count;

Parameters

uaddr64 Specifies the address of user data.
kaddr Specifies the address of kernel data.
count Specifies the number of bytes to copy.

Description

The copyin64 kernel service copies the specified number of bytes from user memory to kernel memory. This service is provided so that system calls and device driver top half routines can safely access user data. The copyin64 service ensures that the user has the appropriate authority to access the data. It also provides recovery from paging I/O errors that would otherwise cause the system to crash.

This service will operate correctly for both 32-bit and 64-bit user address spaces. The uaddr64 parameter is interpreted as being a non-remapped 32-bit address for the case where the current user address space is 32- bits. If the current user address space is 64-bits, then uaddr64 is treated as a 64-bit address.

The copyin64 service should be called only while executing in kernel mode in the user process.

Execution Environment

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

Return Values

0 Indicates a successful operation.
EFAULT Indicates that the user has insufficient authority to access the data, or the address specified in the uaddr64 parameter is not valid.
EIO Indicates that a permanent I/O error occurred while referencing data.
ENOMEM Indicates insufficient memory for the required paging operation.
ENOSPC Indicates insufficient file system or paging space.

Implementation Specifics

The copyin64 kernel service is part of Base Operating System (BOS) Runtime.

Related Information

The copyinstr64 kernel service and copyout64 kernel service.

Accessing User-Mode Data While in Kernel Mode and Memory Kernel Services in AIX Version 4 Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Contents | Home | Search ]