60#include <linux/errqueue.h>
65#define MAX_DEFAULT_FDS 20000
95#define release_fd_lock(fd, mask) { \
96 mutex_lock(&clnt_fd_lock); \
97 dg_fd_locks[fd] = 0; \
98 mutex_unlock(&clnt_fd_lock); \
99 thr_sigsetmask(SIG_SETMASK, &(mask), NULL); \
100 cond_signal(&dg_cv[fd]); \
104#define release_fd_lock(fd, mask) { \
105 mutex_lock(&clnt_fd_lock); \
106 dg_fd_locks[WINSOCK_HANDLE_HASH(fd)] = 0; \
107 mutex_unlock(&clnt_fd_lock); \
109 cond_signal(&dg_cv[WINSOCK_HANDLE_HASH(fd)]); \
156 const struct netbuf *svcaddr;
176 sigfillset(&newmask);
187 fd_allocsz = dtbsize *
sizeof (
int);
196 cv_allocsz = dtbsize *
sizeof (
cond_t);
207 for (
i = 0;
i < dtbsize;
i++)
215 if (svcaddr ==
NULL) {
230 if ((sendsz == 0) || (recvsz == 0)) {
241 sendsz = ((sendsz + 3) / 4) * 4;
242 recvsz = ((recvsz + 3) / 4) * 4;
243 cu =
mem_alloc(
sizeof (*cu) + sendsz + recvsz);
263 call_msg.rm_call.cb_prog =
program;
264 call_msg.rm_call.cb_vers =
version;
306 mem_free(cu,
sizeof (*cu) + sendsz + recvsz);
330 int total_time, nextsend_time, tv=0;
348 sigfillset(&newmask);
365 nextsend_time = cu->
cu_wait.tv_sec * 1000 + cu->
cu_wait.tv_usec / 1000;
402 (! (*xargs)(xdrs, argsp))) {
417 if (total_time <= 0) {
421 nextsend_time = cu->
cu_wait.tv_sec * 1000 + cu->
cu_wait.tv_usec / 1000;
436 reply_msg.acpted_rply.ar_results.where = resultsp;
437 reply_msg.acpted_rply.ar_results.proc = xresults;
442 while (total_time > 0) {
443 tv = total_time < nextsend_time ? total_time : nextsend_time;
445 switch (
poll(&
fd, 1, tv)) {
476 struct cmsghdr *cmsg;
477 struct sock_extended_err *
e;
481 char *cbuf = (
char *)
alloca (outlen + 256);
484 iov.iov_base = cbuf + 256;
485 iov.iov_len = outlen;
486 msg.msg_name = (
void *) &err_addr;
487 msg.msg_namelen =
sizeof (err_addr);
491 msg.msg_control = cbuf;
492 msg.msg_controllen = 256;
496 && (
msg.msg_flags & MSG_ERRQUEUE)
497 && ((
msg.msg_namelen == 0
500 && err_addr.sin_family ==
AF_INET
501 &&
memcmp (&err_addr.sin_addr, &
sin->sin_addr,
502 sizeof (err_addr.sin_addr)) == 0
503 && err_addr.sin_port ==
sin->sin_port)))
504 for (cmsg = CMSG_FIRSTHDR (&
msg); cmsg;
505 cmsg = CMSG_NXTHDR (&
msg, cmsg))
506 if (cmsg->cmsg_level == SOL_IP && cmsg->cmsg_type == IP_RECVERR)
508 e = (
struct sock_extended_err *)
CMSG_DATA(cmsg);
538 if (inval != outval) {
554 (reply_msg.acpted_rply.ar_stat ==
SUCCESS))
561 &reply_msg.acpted_rply.ar_verf, 0)) {
565 if (reply_msg.acpted_rply.ar_verf.oa_base !=
NULL) {
568 &(reply_msg.acpted_rply.ar_verf));
577 if (nrefreshes > 0 &&
616 sigfillset(&newmask);
625 dummy = (*xdr_res)(xdrs, res_ptr);
656 sigfillset(&newmask);
800 sigfillset(&newmask);
822static struct clnt_ops *
825 static struct clnt_ops ops;
833 sigfillset(&newmask);
839 if (ops.cl_call ==
NULL) {
859 return (
t->tv_sec < -1 ||
t->tv_sec > 100000000 ||
860 t->tv_usec < -1 ||
t->tv_usec > 1000000);
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
#define gettimeofday(tv, tz)
static struct sockaddr_in sa
#define AUTH_MARSHALL(auth, xdrs, seq)
#define AUTH_VALIDATE(auth, verfp, seq)
#define AUTH_REFRESH(auth, msg)
int bindresvport_sa(SOCKET sd, struct sockaddr *sa)
#define CLSET_RETRY_TIMEOUT
#define CLGET_RETRY_TIMEOUT
#define CLGET_SERVER_ADDR
static void clnt_dg_destroy(CLIENT *)
static enum clnt_stat clnt_dg_call(CLIENT *, rpcproc_t, xdrproc_t, void *, xdrproc_t, void *, struct timeval)
static const char mem_err_clnt_dg[]
static struct clnt_ops * clnt_dg_ops(void)
#define release_fd_lock(fd, mask)
static bool_t clnt_dg_freeres(CLIENT *, xdrproc_t, void *)
CLIENT * clnt_dg_create(SOCKET fd, const struct netbuf *svcaddr, rpcprog_t program, rpcvers_t version, u_int sendsz, u_int recvsz)
static void clnt_dg_abort(CLIENT *)
static bool_t time_not_ok(struct timeval *)
static void clnt_dg_geterr(CLIENT *, struct rpc_err *)
static bool_t clnt_dg_control(CLIENT *, u_int, void *)
#define mem_free(ptr, bsize)
static const WCHAR version[]
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
INT WSAAPI recvfrom(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags, OUT LPSOCKADDR from, IN OUT INT FAR *fromlen)
INT WSAAPI select(IN INT s, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST struct timeval *timeout)
INT WSAAPI sendto(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags, IN CONST struct sockaddr *to, IN INT tolen)
GLenum const GLvoid * addr
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
#define thr_sigsetmask(f, n, o)
#define cond_init(c, a, p)
struct opaque_auth _null_auth
u_int __rpc_get_t_size(int af, int proto, int size)
int __rpc_fd2sockinfo(SOCKET fd, struct __rpc_sockinfo *sip)
bool_t xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg)
bool_t xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg)
void _seterr_reply(struct rpc_msg *msg, struct rpc_err *error)
_CRTIMP int __cdecl _getpid(void)
INT WSAAPI setsockopt(IN SOCKET s, IN INT level, IN INT optname, IN CONST CHAR FAR *optval, IN INT optlen)
struct __rpc_client::clnt_ops * cl_ops
struct sockaddr_storage cu_raddr
int PASCAL FAR WSAGetLastError(void)
#define WINSOCK_HANDLE_HASH(x)
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define XDR_PUTINT32(xdrs, int32p)
#define XDR_SETPOS(xdrs, pos)
#define XDR_DESTROY(xdrs)
bool_t(* xdrproc_t)(XDR *,...)
#define BYTES_PER_XDR_UNIT
void xdrmem_create(XDR *xdrs, char *addr, u_int size, enum xdr_op op)