/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Portions of this source code were derived from Berkeley
* under license from the Regents of the University of
* California.
*/
#include "mt.h"
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
char **);
extern int __yp_master_rsvdport(char *, char *, char **);
/*
* This checks parameters, and implements the outer "until binding success"
* loop.
*/
int
{
int reason;
return (YPERR_BADARGS);
return (YPERR_BADARGS);
for (;;) {
return (reason);
master);
(void) sleep(_ypsleeptime);
} else {
break;
}
} else {
return (YPERR_VERS);
}
}
/*
* Lookup could be for a secure map; fail over to retry
* from a reserved port. Only useful to try this if we're
* the super user.
*/
int rsvdreason;
if (rsvdreason == 0)
reason = rsvdreason;
}
return (reason);
}
/*
* This function is identical to 'yp_master' with the exception that it calls
* '__yp_dobind_rsvdport' rather than '__yp_dobind'
*/
int
{
int reason;
return (YPERR_BADARGS);
return (YPERR_BADARGS);
for (;;) {
return (reason);
master);
/*
* Have to free the binding since the reserved
* port bindings are not cached.
*/
(void) sleep(_ypsleeptime);
} else {
break;
}
} else {
/*
* Have to free the binding since the reserved
* port bindings are not cached.
*/
return (YPERR_VERS);
}
}
return (reason);
}
/*
* This talks v2 to ypserv
*/
static int
{
unsigned int retval = 0;
/*
* Do the get_master request. If the rpc call failed, return with
* status from this point.
*/
timeout) != RPC_SUCCESS)
return (YPERR_RPC);
/* See if the request succeeded */
/* Get some memory which the user can get rid of as he likes */
if (!retval)
return (retval);
}