Note: This function can only be used in an IBM® i PASE
program. See the IBM PASE for i topic collection for more
information about creating IBM PASE for i 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 IBM i exception message that the system
converts to an IBM PASE for i signal. See IBM PASE for i
Signal Handling for information about handling IBM i exceptions.
Usage Notes
_STRNCPY_SPP can copy between any memory areas addressable
through tagged space pointers, which need not be in the IBM PASE for i address
space.
_STRNCPY_SPP is implemented with a kernel system call, so
it generally runs slower than strncpy.