svc_run_as.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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) 1993-1998 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/* Taken from 4.1.3 ypserv resolver code. */
/*
* This is an example of using rpc_as.h an asynchronous polling
* mechanism, asynchronously polled fds are combined with the
* service fds. The minimum timeout is calculated, and
* the user waits for that timeout or activity on either the
* async pollset or the svc pollset.
*/
#include <errno.h>
#include <stdlib.h>
#include "rpc_as.h"
#include <stropts.h>
#include <string.h>
#include <poll.h>
#include "prnt.h"
extern int __rpc_timeval_to_msec(struct timeval *t);
/*
* Merge two arrays of pollfd's, assumptions:
* Arrays are ordered so element N contains descriptor N
* Out array is as large as max(asize, bsize)
*/
static void
{
int i;
int outsize;
for (i = 0; i < outsize; i++) {
out[i] = a[i];
out[i] = b[i];
else
}
}
void
{
struct pollfd *as_pollset;
int nfds = 0;
int max_fds;
int as_max_pollfd;
int pollret = 0;
for (;;) {
}
if (nfds == 0)
break; /* None waiting, hence return */
/*
* Merge together rpc_as_get_pollset and svc_pollfd
*/
__rpc_timeval_to_msec(&timeout)))) {
case -1:
continue;
}
return;
case 0:
break;
default:
}
}
}