import less(1)
[unleashed/tickless.git] / usr / src / lib / libc / port / nsl / rpc_mt.h
blob2fd0742341d91c23c7d363222f209ea34e5f744c
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
28 * Contains the mt libraries include definitions
31 #ifndef _RPC_MT_H
32 #define _RPC_MT_H
34 #pragma ident "%Z%%M% %I% %E% SMI"
36 #include <sys/types.h>
37 #include <rpc/rpc.h>
38 #include <netconfig.h>
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
45 * declaration to private interfaces in rpc library
48 extern int svc_npollfds;
49 extern int svc_npollfds_set;
50 extern int svc_pollfd_allocd;
51 extern rwlock_t svc_fd_lock;
54 * macros to handle pollfd array; ***** Note that the macro takes
55 * address of the array ( &array[0] ) always not the address of an
56 * element *****.
59 #define MASKVAL (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND)
60 #define POLLFD_EXTEND 64
61 #define POLLFD_SHRINK (2 * POLLFD_EXTEND)
62 #define POLLFD_SET(x, y) { \
63 (y)[(x)].fd = (x); \
64 (y)[(x)].events = MASKVAL; \
66 #define POLLFD_CLR(x, y) { \
67 (y)[(x)].fd = -1; \
68 (y)[(x)].events = 0; \
69 (y)[(x)].revents = 0; \
71 #define POLLFD_ISSET(x, y) ((y)[(x)].fd >= 0)
74 extern int __rpc_use_pollfd_done;
75 extern int __rpc_rlim_max(void);
77 /* Following functions create and manipulates the dgfd lock object */
79 extern void *rpc_fd_init(void);
80 extern int rpc_fd_lock(const void *handle, int fd);
81 extern void rpc_fd_unlock(const void *handle, int fd);
83 #define RPC_FD_NOTIN_FDSET(x) (!__rpc_use_pollfd_done && (x) >= FD_SETSIZE)
84 #define FD_INCREMENT FD_SETSIZE
87 * External functions without prototypes. This is somewhat crufty, but
88 * there is no other header file for this directory. One should probably
89 * be created and this stuff moved there if there turns out to be no better
90 * way to avoid the warnings.
93 #define RPC_MINFD 3
95 #define RPC_RAISEFD(fd) if (fd < RPC_MINFD) \
96 fd = __rpc_raise_fd(fd)
98 extern int __getpublickey_cached(char *, char *, int *);
99 extern void __getpublickey_flush(const char *);
100 extern int __can_use_af(sa_family_t);
101 extern int __rpc_raise_fd(int);
102 extern void __tli_sys_strerror(char *, size_t, int, int);
104 #ifdef __cplusplus
106 #endif
108 #endif /* !_RPC_MT_H */