ReactOS  0.4.15-dev-1187-g119f102
svc_run.c File Reference
#include <wintirpc.h>
#include <reentrant.h>
#include <errno.h>
#include <rpc/rpc.h>
#include <stdio.h>
#include <string.h>
#include "rpc_com.h"
Include dependency graph for svc_run.c:

Go to the source code of this file.

Functions

void svc_run ()
 
void svc_exit ()
 

Function Documentation

◆ svc_exit()

void svc_exit ( void  )

Definition at line 84 of file svc_run.c.

85 {
86  extern rwlock_t svc_fd_lock;
87 
91 }
#define rwlock_wrlock(l)
Definition: reentrant.h:140
fd_set svc_fdset
#define FD_ZERO(set)
Definition: winsock.h:96
#define rwlock_unlock(l)
Definition: reentrant.h:142
rwlock_t svc_fd_lock
Definition: mt_misc.c:22

◆ svc_run()

void svc_run ( void  )

Definition at line 48 of file svc_run.c.

49 {
50  fd_set readfds, cleanfds;
51  struct timeval timeout;
52  extern rwlock_t svc_fd_lock;
53 
54 
55  for (;;) {
57  readfds = svc_fdset;
58  cleanfds = svc_fdset;
60  timeout.tv_sec = 30;
61  timeout.tv_usec = 0;
62  switch (select(svc_maxfd+1, &readfds, NULL, NULL, &timeout)) {
63  case SOCKET_ERROR:
64  FD_ZERO(&readfds);
65  if (WSAGetLastError() == WSAEINTR) {
66  continue;
67  }
68  // XXX warn("svc_run: - select failed");
69  return;
70  case 0:
71  __svc_clean_idle(&cleanfds, 30, FALSE);
72  continue;
73  default:
74  svc_getreqset(&readfds);
75  }
76  }
77 }
Definition: winsock.h:66
#define SOCKET_ERROR
Definition: winsock.h:333
fd_set svc_fdset
Definition: dhcpd.h:245
#define FD_ZERO(set)
Definition: winsock.h:96
#define FALSE
Definition: types.h:117
bool_t __svc_clean_idle(fd_set *, int, bool_t)
Definition: svc_vc.c:820
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)
Definition: select.c:41
#define rwlock_unlock(l)
Definition: reentrant.h:142
smooth NULL
Definition: ftsmooth.c:416
INT WSAAPI WSAGetLastError(VOID)
Definition: dllmain.c:112
void svc_getreqset(fd_set *readfds)
Definition: svc.c:615
rwlock_t svc_fd_lock
Definition: mt_misc.c:22
int svc_maxfd
#define rwlock_rdlock(l)
Definition: reentrant.h:139
#define WSAEINTR
Definition: winerror.h:1942