_STRNCPY_SPP()--Copy Character String for i5/OS PASE


  Syntax
 #include <as400_protos.h>

 void _STRNCPY_SPP(const ILEpointer  *target,
                   const ILEpointer  *source,
                   size_t            length);

  Default Public Authority: *USE

  Library: Standard C Library (libc.a)

  Threadsafe: Yes

Note: This function can only be used in an i5/OS PASE program. See i5/OS PASE for more information about creating i5/OS PASE programs.

The _STRNCPY_SPP() function copies a null-terminated character string. It performs the same operation as the strncpy function, but uses 16-byte tagged space pointers to locate the source and target strings.


Parameters

target
(Output) Pointer to target buffer. Target is the 16-byte aligned address of a tagged space pointer to the target buffer.

source
(Input) Pointer to source string. source is the 16-byte aligned address of a tagged space pointer to the source character string.

length
(Input) Specifies the maximum number of bytes to copy between the source and target. If the source string is too long, then only the specified number of bytes are copied and the target string is not terminated with a null. If the source string is too short, the copy is padded with nulls to fill the target buffer.


Authorities

_STRNCPY_SPP requires no authority.


Error Conditions

Any error is reported with an i5/OS exception message that the system converts to an i5/OS PASE signal. See i5/OS PASE Signal Handling for information about handling i5/OS exceptions.


Usage Notes

  1. _STRNCPY_SPP can copy between any memory areas addressable through tagged space pointers, which need not be in the i5/OS PASE address space.

  2. _STRNCPY_SPP is implemented with a kernel system call, so it generally runs slower than strncpy.

Related Information



API introduced: V4R5
Top | i5/OS PASE APIs | APIs by category