[  Next Article  |
Previous Article  |
Book Contents |
Library Home |
Legal |
Search ]
Kernel and Subsystems Technical Reference, Volume 1
copyinstr Kernel Service
Purpose
Copies a character string (including the terminating 
null character) from user to kernel space.
Syntax
#include <sys/types.h>
#include <sys/errno.h>
int copyinstr 
(from, to, max, actual)
caddt_t from;
caddt_t to;
uint max;
uint *actual;
Parameters
| from | 
  Specifies the address of the 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 
copyinstr service with the actual number of characters copied. | 
Description
The copyinstr kernel 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.
The copyinstr 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 uaddr parameter is not valid. | 
Implementation Specifics
The copyinstr kernel service is part of Base 
Operating System (BOS) Runtime.
Related Information
Accessing User-Mode Data While in 
Kernel Mode and Memory 
Kernel Services in AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts.
[  Next Article  |
Previous Article  |
Book Contents |
Library Home |
Legal |
Search ]