17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 545916cd2Sjpk * Common Development and Distribution License (the "License"). 645916cd2Sjpk * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 21e8031f0aSraf 227c478bd9Sstevel@tonic-gate /* 23e8031f0aSraf * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate /* 287c478bd9Sstevel@tonic-gate * Contains the mt libraries include definitions 297c478bd9Sstevel@tonic-gate */ 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate #ifndef _RPC_MT_H 327c478bd9Sstevel@tonic-gate #define _RPC_MT_H 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate #include <sys/types.h> 377c478bd9Sstevel@tonic-gate #include <rpc/rpc.h> 3845916cd2Sjpk #include <netconfig.h> 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate #ifdef __cplusplus 417c478bd9Sstevel@tonic-gate extern "C" { 427c478bd9Sstevel@tonic-gate #endif 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gate /* 457c478bd9Sstevel@tonic-gate * declaration to private interfaces in rpc library 467c478bd9Sstevel@tonic-gate */ 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gate extern int svc_npollfds; 497c478bd9Sstevel@tonic-gate extern int svc_npollfds_set; 507c478bd9Sstevel@tonic-gate extern int svc_pollfd_allocd; 517c478bd9Sstevel@tonic-gate extern rwlock_t svc_fd_lock; 527c478bd9Sstevel@tonic-gate 537c478bd9Sstevel@tonic-gate /* 547c478bd9Sstevel@tonic-gate * macros to handle pollfd array; ***** Note that the macro takes 557c478bd9Sstevel@tonic-gate * address of the array ( &array[0] ) always not the address of an 567c478bd9Sstevel@tonic-gate * element *****. 577c478bd9Sstevel@tonic-gate */ 587c478bd9Sstevel@tonic-gate 597c478bd9Sstevel@tonic-gate #define MASKVAL (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND) 607c478bd9Sstevel@tonic-gate #define POLLFD_EXTEND 64 617c478bd9Sstevel@tonic-gate #define POLLFD_SHRINK (2 * POLLFD_EXTEND) 627c478bd9Sstevel@tonic-gate #define POLLFD_SET(x, y) { \ 637c478bd9Sstevel@tonic-gate (y)[(x)].fd = (x); \ 647c478bd9Sstevel@tonic-gate (y)[(x)].events = MASKVAL; \ 657c478bd9Sstevel@tonic-gate } 667c478bd9Sstevel@tonic-gate #define POLLFD_CLR(x, y) { \ 677c478bd9Sstevel@tonic-gate (y)[(x)].fd = -1; \ 687c478bd9Sstevel@tonic-gate (y)[(x)].events = 0; \ 697c478bd9Sstevel@tonic-gate (y)[(x)].revents = 0; \ 707c478bd9Sstevel@tonic-gate } 717c478bd9Sstevel@tonic-gate #define POLLFD_ISSET(x, y) ((y)[(x)].fd >= 0) 727c478bd9Sstevel@tonic-gate 737c478bd9Sstevel@tonic-gate 747c478bd9Sstevel@tonic-gate extern int __rpc_use_pollfd_done; 757c478bd9Sstevel@tonic-gate extern int __rpc_rlim_max(void); 767c478bd9Sstevel@tonic-gate 777c478bd9Sstevel@tonic-gate /* Following functions create and manipulates the dgfd lock object */ 787c478bd9Sstevel@tonic-gate 797c478bd9Sstevel@tonic-gate extern void *rpc_fd_init(void); 807c478bd9Sstevel@tonic-gate extern int rpc_fd_lock(const void *handle, int fd); 817c478bd9Sstevel@tonic-gate extern void rpc_fd_unlock(const void *handle, int fd); 827c478bd9Sstevel@tonic-gate 837c478bd9Sstevel@tonic-gate #define RPC_FD_NOTIN_FDSET(x) (!__rpc_use_pollfd_done && (x) >= FD_SETSIZE) 847c478bd9Sstevel@tonic-gate #define FD_INCREMENT FD_SETSIZE 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate /* 877c478bd9Sstevel@tonic-gate * External functions without prototypes. This is somewhat crufty, but 887c478bd9Sstevel@tonic-gate * there is no other header file for this directory. One should probably 897c478bd9Sstevel@tonic-gate * be created and this stuff moved there if there turns out to be no better 907c478bd9Sstevel@tonic-gate * way to avoid the warnings. 917c478bd9Sstevel@tonic-gate */ 927c478bd9Sstevel@tonic-gate 93*004388ebScasper #define RPC_MINFD 3 94*004388ebScasper 95*004388ebScasper #define RPC_RAISEFD(fd) if (fd < RPC_MINFD) \ 96*004388ebScasper fd = __rpc_raise_fd(fd) 97*004388ebScasper 987c478bd9Sstevel@tonic-gate extern int __getpublickey_cached(char *, char *, int *); 997c478bd9Sstevel@tonic-gate extern void __getpublickey_flush(const char *); 1007c478bd9Sstevel@tonic-gate extern int __can_use_af(sa_family_t); 1017c478bd9Sstevel@tonic-gate extern int __rpc_raise_fd(int); 10245916cd2Sjpk extern void __rpc_set_mac_options(int, const struct netconfig *, 10345916cd2Sjpk rpcprog_t); 1047c478bd9Sstevel@tonic-gate extern void __tli_sys_strerror(char *, size_t, int, int); 1057c478bd9Sstevel@tonic-gate 1067c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1077c478bd9Sstevel@tonic-gate } 1087c478bd9Sstevel@tonic-gate #endif 1097c478bd9Sstevel@tonic-gate 1107c478bd9Sstevel@tonic-gate #endif /* !_RPC_MT_H */ 111