59 #include <asm/types.h> 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)) {
448 #error Not supported! 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);
822 static 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);
u_int __rpc_get_t_size(int af, int proto, int size)
INT WSAAPI recvfrom(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags, OUT LPSOCKADDR from, IN OUT INT FAR *fromlen)
static bool_t clnt_dg_freeres(CLIENT *, xdrproc_t, void *)
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define XDR_PUTINT32(xdrs, int32p)
#define CLSET_RETRY_TIMEOUT
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
ACPI_SIZE strlen(const char *String)
void _seterr_reply(struct rpc_msg *msg, struct rpc_err *error)
static bool_t time_not_ok(struct timeval *)
static void clnt_dg_abort(CLIENT *)
#define cond_init(c, a, p)
#define CLGET_RETRY_TIMEOUT
INT WSAAPI connect(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
GLfloat GLfloat GLfloat GLfloat h
#define release_fd_lock(fd, mask)
#define gettimeofday(tv, tz)
bool_t(* xdrproc_t)(XDR *,...)
struct opaque_auth _null_auth
int __rpc_fd2sockinfo(SOCKET fd, struct __rpc_sockinfo *sip)
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)
_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)
static bool_t clnt_dg_control(CLIENT *, u_int, void *)
static const WCHAR version[]
#define WINSOCK_HANDLE_HASH(x)
#define CLGET_SERVER_ADDR
INT WSAAPI WSAGetLastError(VOID)
struct sockaddr_storage cu_raddr
int poll(struct pollfd *ufds, int nfds, int timeout)
static void clnt_dg_geterr(CLIENT *, struct rpc_err *)
#define thr_sigsetmask(f, n, o)
GLenum const GLvoid * addr
#define memcpy(s1, s2, n)
#define XDR_SETPOS(xdrs, pos)
static struct clnt_ops * clnt_dg_ops(void)
static const char mem_err_clnt_dg[]
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 AUTH_REFRESH(auth, msg)
void xdrmem_create(XDR *xdrs, char *addr, u_int size, enum xdr_op op)
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)
#define AUTH_MARSHALL(auth, xdrs, seq)
#define mem_free(ptr, bsize)
CLIENT * clnt_dg_create(SOCKET fd, const struct netbuf *svcaddr, rpcprog_t program, rpcvers_t version, u_int sendsz, u_int recvsz)
static enum clnt_stat clnt_dg_call(CLIENT *, rpcproc_t, xdrproc_t, void *, xdrproc_t, void *, struct timeval)
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
#define AUTH_VALIDATE(auth, verfp, seq)
int bindresvport_sa(SOCKET sd, struct sockaddr *sa)
static void clnt_dg_destroy(CLIENT *)
struct __rpc_client::clnt_ops * cl_ops
bool_t xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg)
bool_t xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg)
static struct sockaddr_in sa
#define XDR_DESTROY(xdrs)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
#define BYTES_PER_XDR_UNIT