/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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) 1998-2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#include <memory.h>
#include <stropts.h>
#include <netconfig.h>
#include <stropts.h>
#include <syslog.h>
#include <rpcsvc/bootparam_prot.h>
#include "bootparam_private.h"
int debug = 0;
static void closedown(int);
int
{
int c;
switch ((char)c) {
case 'd':
debug++;
break;
default:
}
/*
* Set non-blocking mode and maximum record size for
* connection oriented RPC transports.
*/
msgout("unable to set maximum RPC record size");
}
/*
* If stdin looks like a TLI endpoint, we assume
* that we were started by a port monitor. If
* t_getstate fails with TBADF, this is not a
* TLI endpoint.
*/
char *netid;
int pmclose;
if (debug)
msgout("cannot get transport name");
if (debug)
msgout("cannot get transport info");
}
msgout("cannot create server handle");
}
if (nconf)
bootparamprog_1, 0)) {
msgout("unable to register (BOOTPARAMPROG, "
"BOOTPARAMVERS).");
}
if (pmclose) {
(void) alarm(_RPCSVC_CLOSEDOWN);
}
svc_run();
/* NOTREACHED */
}
/*
* run this process in the background only if it was started from
* a shell and the debug flag was not given.
*/
if (!server_child && !debug) {
if (pid < 0) {
perror("cannot fork");
}
if (pid)
closefrom(0);
(void) setsid();
}
/*
* messges go to syslog if the program was started by
* another server, or if it was run from the command line without
* the debug flag.
*/
if (server_child || !debug)
if (debug) {
if (debug == 1)
msgout("in debug mode.");
else
}
"netpath")) {
msgout("unable to create (BOOTPARAMPROG, BOOTPARAMVERS) "
"for netpath.");
}
svc_run();
msgout("svc_run returned");
return (EXIT_FAILURE);
}
static void
{
union {
} argument;
char *result;
char *(*local)();
_rpcsvcdirty = 1;
case NULLPROC:
_rpcsvcdirty = 0;
return;
case BOOTPARAMPROC_WHOAMI:
local = (char *(*)()) bootparamproc_whoami_1;
break;
case BOOTPARAMPROC_GETFILE:
local = (char *(*)()) bootparamproc_getfile_1;
break;
default:
_rpcsvcdirty = 0;
return;
}
_rpcsvcdirty = 0;
return;
}
}
msgout("unable to free arguments");
}
_rpcsvcdirty = 0;
}
/*PRINTFLIKE1*/
void
{
/*
* messges go to syslog if the program was started by
* another server, or if it was run from the command line without
* the debug flag.
*/
if (server_child || !debug)
else {
}
}
/* ARGSUSED */
static void
{
if (_rpcsvcdirty == 0) {
int size;
int i, openfd;
if (svc_pollfd[i].fd >= 0)
openfd++;
if (openfd <= 1)
}
(void) alarm(_RPCSVC_CLOSEDOWN);
}