HP-UX Reference (11i v2 03/08) - 3 Library Functions N-Z (vol 7)
n
nis_error(3N) nis_error(3N)
NAME
nis_error, nis_sperrno, nis_perror, nis_lerror, nis_sperror, nis_sperror_r - display NIS+ error messages
SYNOPSIS
cc [ flag ... ] file...
-lnsl [ library. . . ]
#include <rpcsvc/nis.h>
char *nis_sperrno(const nis_error
status );
void nis_perror(const nis_error
status ,
const char *label);
void nis_lerror(const nis_error
status ,
const char *label);
char *nis_sperror_r(nis_error
status ,
char *
label,
char * buf);
char *nis_sperror(const nis_error
status ,
const char *label);
DESCRIPTION
These functions convert NIS+ status values into text strings.
nis_sperrno() simply returns a pointer to a string constant which is the error string.
nis_perror( ) prints the error message corresponding to status as ‘‘label :
error message’’ on
standard error.
nis_lerror() sends the error text to syslog(3C) at level LOG_ERR.
The function
nis_sperror_r()
, returns a pointer to a string that can be used or copied using the
strdup() function (see string (3C).) 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).
The last function,
nis_sperror()
, is similar to nis_sperror_r() except that the string is returned
as a pointer to a buffer that is reused on each call.
nis_sperror_r()
is the preferred interface, since
it is suitable for single-threaded and multithreaded programs.
MULTITHREAD USAGE
Thread Safe: Yes
Cancel Safe: Yes
Fork Safe: No
Async-cancel Safe: No
Async-signal Safe: No
These functions can be called safely in a multithreaded environment. These functions may be thread can-
cellation points because they invoke functions that are thread cancellation points.
In a multithreaded environment, these functions are not safe to be called by a child process after fork()
and before exec(). These functions should not be called by a multithreaded application that support asyn-
chronous cancellation or asynchronous signals.
WARNINGS
HP-UX 11i Version 2 is the last HP-UX release on which NIS+ is supported.
LDAP is the recommended replacement for NIS+. HP fully supports the industry standard naming ser-
vices based on LDAP.
SEE ALSO
niserror(1), string(3C), syslog(3C).
HP-UX 11i Version 2: August 2003 − 1 − Hewlett-Packard Company Section 3−−643