yp_bind Subroutine
Purpose
Used in programs to call the ypbind daemon directly for processes that use backup strategies when Network Information Services (NIS) is not available.
Library
C Library (libc.a)
Syntax
#include <rpcsvc/ypclnt.h>
#include <rpcsvc/yp_prot.h>
char *indomain;
Description
In order to use NIS, the client process must be bound to an NIS server that serves the appropriate domain. That is, the client must be associated with a specific NIS server that services the client's requests for NIS information. The NIS lookup processes automatically use the ypbind daemon to bind the client, but the yp_bind subroutine can be used in programs to call the daemon directly for processes that use backup strategies (for example, a local file) when NIS is not available.
Each NIS binding allocates, or uses up, one client process socket descriptor, and each bound domain uses one socket descriptor. Multiple requests to the same domain use the same descriptor.
- The client process cannot bind a server for the proper domain.
- RPCs to the server fail.
Parameters
Item | Description |
---|---|
indomain | Points to the name of the domain for which to attempt the bind. |
Return Values
The NIS client returns control to the user with either an error or a success code if any of the following occurs:
- The error is not related to RPC.
- The ypbind daemon is not running.
- The ypserv daemon returns the answer.