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

copyout64 Kernel Service


Copies data between user and kernel memory.


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

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


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


The copyout64 service copies the specified number of bytes from kernel memory to user memory. It is provided so that system calls and device driver top half routines can safely access user data. The copyout64 service ensures that the user has the appropriate authority to access the data. This service 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 copyout64 service should be called only while executing in kernel mode in the user process.

Execution Environment

The copyout64 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 copyout64 kernel service is part of Base Operating System (BOS) Runtime.

Related Information

The copyinstr64 kernel service and copyin64 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 ]