Go to main content

man pages section 3: Basic Library Functions

Exit Print View

Updated: Thursday, June 13, 2019
 
 

yp_update(3C)

Name

yp_update - change NIS information

Synopsis

#include <rpcsvc/ypclnt.h>

int yp_update(char *domain, char *map, unsigned ypop, char *key,
     char *int keylen, char *data, int datalen);

Description

yp_update() is used to make changes to the NIS database. The syntax is the same as that of yp_match() except for the extra parameter ypop which may take on one of four values. If it is POP_CHANGE then the data associated with the key will be changed to the new value. If the key is not found in the database, then yp_update() will return YPERR_KEY. If ypop has the value YPOP_INSERT then the key-value pair will be inserted into the database. The error YPERR_KEY is returned if the key already exists in the database. To store an item into the database without concern for whether it exists already or not, pass ypop as YPOP_STORE and no error will be returned if the key already or does not exist. To delete an entry, the value of ypop should be YPOP_DELETE.

This routine depends upon secure RPC, and will not work unless the network is running secure RPC.

Return Values

If the value of ypop is POP_CHANGE, yp_update() returns the error YPERR_KEY if the key is not found in the database.

If the value of ypop is POP_INSERT, yp_update() returns the error YPERR_KEY if the key already exists in the database.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
MT-Level
Unsafe

See Also

secure_rpc(3C), ypclnt(3C), attributes(7)

Notes

This interface is unsafe in multithreaded applications. Unsafe interfaces should be called only from the main thread.