rpc_mt.h revision 004388ebfdfe2ed7dfd2d153a876dfcc22d2c006
1N/A/*
1N/A * CDDL HEADER START
1N/A *
1N/A * The contents of this file are subject to the terms of the
1N/A * Common Development and Distribution License (the "License").
1N/A * You may not use this file except in compliance with the License.
1N/A *
1N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1N/A * or http://www.opensolaris.org/os/licensing.
1N/A * See the License for the specific language governing permissions
1N/A * and limitations under the License.
1N/A *
1N/A * When distributing Covered Code, include this CDDL HEADER in each
1N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1N/A * If applicable, add the following below this CDDL HEADER, with the
1N/A * fields enclosed by brackets "[]" replaced with your own identifying
1N/A * information: Portions Copyright [yyyy] [name of copyright owner]
1N/A *
1N/A * CDDL HEADER END
1N/A */
1N/A
1N/A/*
1N/A * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
1N/A * Use is subject to license terms.
1N/A */
1N/A
1N/A/*
1N/A * Contains the mt libraries include definitions
1N/A */
1N/A
1N/A#ifndef _RPC_MT_H
1N/A#define _RPC_MT_H
1N/A
1N/A#pragma ident "%Z%%M% %I% %E% SMI"
1N/A
1N/A#include <sys/types.h>
1N/A#include <rpc/rpc.h>
1N/A#include <netconfig.h>
1N/A
1N/A#ifdef __cplusplus
1N/Aextern "C" {
1N/A#endif
1N/A
1N/A/*
1N/A * declaration to private interfaces in rpc library
1N/A */
1N/A
1N/Aextern int svc_npollfds;
1N/Aextern int svc_npollfds_set;
1N/Aextern int svc_pollfd_allocd;
1N/Aextern rwlock_t svc_fd_lock;
1N/A
1N/A/*
1N/A * macros to handle pollfd array; ***** Note that the macro takes
1N/A * address of the array ( &array[0] ) always not the address of an
1N/A * element *****.
1N/A */
1N/A
1N/A#define MASKVAL (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND)
1N/A#define POLLFD_EXTEND 64
1N/A#define POLLFD_SHRINK (2 * POLLFD_EXTEND)
1N/A#define POLLFD_SET(x, y) { \
1N/A (y)[(x)].fd = (x); \
1N/A (y)[(x)].events = MASKVAL; \
1N/A }
1N/A#define POLLFD_CLR(x, y) { \
1N/A (y)[(x)].fd = -1; \
1N/A (y)[(x)].events = 0; \
1N/A (y)[(x)].revents = 0; \
1N/A }
1N/A#define POLLFD_ISSET(x, y) ((y)[(x)].fd >= 0)
1N/A
1N/A
1N/Aextern int __rpc_use_pollfd_done;
1N/Aextern int __rpc_rlim_max(void);
1N/A
1N/A/* Following functions create and manipulates the dgfd lock object */
1N/A
1N/Aextern void *rpc_fd_init(void);
1N/Aextern int rpc_fd_lock(const void *handle, int fd);
1N/Aextern void rpc_fd_unlock(const void *handle, int fd);
1N/A
1N/A#define RPC_FD_NOTIN_FDSET(x) (!__rpc_use_pollfd_done && (x) >= FD_SETSIZE)
1N/A#define FD_INCREMENT FD_SETSIZE
1N/A
1N/A/*
1N/A * External functions without prototypes. This is somewhat crufty, but
1N/A * there is no other header file for this directory. One should probably
1N/A * be created and this stuff moved there if there turns out to be no better
1N/A * way to avoid the warnings.
1N/A */
1N/A
1N/A#define RPC_MINFD 3
1N/A
1N/A#define RPC_RAISEFD(fd) if (fd < RPC_MINFD) \
1N/A fd = __rpc_raise_fd(fd)
1N/A
1N/Aextern int __getpublickey_cached(char *, char *, int *);
1N/Aextern void __getpublickey_flush(const char *);
1N/Aextern int __can_use_af(sa_family_t);
1N/Aextern int __rpc_raise_fd(int);
1N/Aextern void __rpc_set_mac_options(int, const struct netconfig *,
1N/A rpcprog_t);
1N/Aextern void __tli_sys_strerror(char *, size_t, int, int);
1N/A
1N/A#ifdef __cplusplus
1N/A}
1N/A#endif
1N/A
1N/A#endif /* !_RPC_MT_H */
1N/A