nis_sperror (NIS+ API)

Purpose

Returns a pointer to a string that can be used or copied using the strdup function.

Syntax

cc
 [ 
flag
 ... ] 
file
 ... 
-lnsl
 [ 
library
 ... ]
#include <rpcsvc/nis.h>
char * nis_sperror(nis_error status, char * label);

Description

One of a group of NIS+ APIs that convert NIS+ status values into strings, nis_sperror returns a pointer to a string that can be used or copied using the strdup function. The caller must supply a string buffer, buf, large enough to hold the error string (a buffer size of 128 bytes is guaranteed to be sufficiently large). status and label are the same as for nis_perror. The pointer returned by the function is a pointer to buf. length specifies the number of characters to copy from the error string to buf. The string is returned as a pointer to a buffer that is reused on each call.

Note: When compiling multithreaded applications, see Writing Reentrant and Thread-Safe Code for information about the use of the _REENTRANT flag.