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

Technical Reference: Kernel and Subsystems, Volume 1

copyinstr64 Kernel Service

Purpose

Copies data between user and kernel memory.

Syntax

#include <sys/types.h>
#include <sys/ernno.h>
#include <sys/uio.h>
int copyinstr64 (from64, to, max, actual);
unsigned long long from64;
caddr_t  to;
uint max;
uint * actual;

Parameters

from64 Specifies the address of character string to copy.
to Specifies the address to which the character string is to be copied.
max Specifies the number of characters to be copied.
actual Specifies a parameter, passed by reference, that is updated by the copyinstr64 service with the actual number of characters copied.

Description

The copyinstr64 service permits a user to copy character data from one location to another. The source location must be in user space or can be in kernel space if the caller is a kernel process. The destination is in kernel space.

This service will operate correctly for both 32-bit and 64-bit user address spaces. The from64 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 from64 is treated as a 64-bit address.

Execution Environment

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

Return Values

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

Related Information

The copyinstr64 kernel service and copyout64 kernel service.

Accessing User-Mode Data While in Kernel Mode and Memory Kernel Services 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 ]