apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: apr/poll/os2 poll.c pollset.c Makefile.in
Date Sat, 22 Nov 2003 01:45:45 GMT
bjh         2003/11/21 17:45:45

  Modified:    poll/os2 pollset.c Makefile.in
  Added:       poll/os2 poll.c
  Log:
  Resurrect poll.c for apr_poll() rather than having it in pollset.c.
  
  Revision  Changes    Path
  1.7       +0 -87     apr/poll/os2/pollset.c
  
  Index: pollset.c
  ===================================================================
  RCS file: /home/cvs/apr/poll/os2/pollset.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- pollset.c	21 Nov 2003 19:50:02 -0000	1.6
  +++ pollset.c	22 Nov 2003 01:45:44 -0000	1.7
  @@ -256,90 +256,3 @@
       *descriptors = pollset->result_set;
       return APR_SUCCESS;
   }
  -
  -APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num,
  -                      apr_int32_t *nsds, apr_interval_time_t timeout)
  -{
  -    int *pollset;
  -    int i;
  -    int num_read = 0, num_write = 0, num_except = 0, num_total;
  -    int pos_read, pos_write, pos_except;
  -
  -    for (i = 0; i < num; i++) {
  -        if (aprset[i].desc_type == APR_POLL_SOCKET) {
  -            num_read += (aprset[i].reqevents & APR_POLLIN) != 0;
  -            num_write += (aprset[i].reqevents & APR_POLLOUT) != 0;
  -            num_except += (aprset[i].reqevents & APR_POLLPRI) != 0;
  -        }
  -    }
  -
  -    num_total = num_read + num_write + num_except;
  -    pollset = alloca(sizeof(int) * num_total);
  -    memset(pollset, 0, sizeof(int) * num_total);
  -
  -    pos_read = 0;
  -    pos_write = num_read;
  -    pos_except = pos_write + num_write;
  -
  -    for (i = 0; i < num; i++) {
  -        if (aprset[i].desc_type == APR_POLL_SOCKET) {
  -            if (aprset[i].reqevents & APR_POLLIN) {
  -                pollset[pos_read++] = aprset[i].desc.s->socketdes;
  -            }
  -
  -            if (aprset[i].reqevents & APR_POLLOUT) {
  -                pollset[pos_write++] = aprset[i].desc.s->socketdes;
  -            }
  -
  -            if (aprset[i].reqevents & APR_POLLPRI) {
  -                pollset[pos_except++] = aprset[i].desc.s->socketdes;
  -            }
  -
  -            aprset[i].rtnevents = 0;
  -        }
  -    }
  -
  -    if (timeout > 0) {
  -        timeout /= 1000; /* convert microseconds to milliseconds */
  -    }
  -
  -    i = select(pollset, num_read, num_write, num_except, timeout);
  -    (*nsds) = i;
  -
  -    if ((*nsds) < 0) {
  -        return APR_FROM_OS_ERROR(sock_errno());
  -    }
  -
  -    if ((*nsds) == 0) {
  -        return APR_TIMEUP;
  -    }
  -
  -    pos_read = 0;
  -    pos_write = num_read;
  -    pos_except = pos_write + num_write;
  -
  -    for (i = 0; i < num; i++) {
  -        if (aprset[i].desc_type == APR_POLL_SOCKET) {
  -            if (aprset[i].reqevents & APR_POLLIN) {
  -                if (pollset[pos_read++] > 0) {
  -                    aprset[i].rtnevents |= APR_POLLIN;
  -                }
  -            }
  -
  -            if (aprset[i].reqevents & APR_POLLOUT) {
  -                if (pollset[pos_write++] > 0) {
  -                    aprset[i].rtnevents |= APR_POLLOUT;
  -                }
  -            }
  -
  -            if (aprset[i].reqevents & APR_POLLPRI) {
  -                if (pollset[pos_except++] > 0) {
  -                    aprset[i].rtnevents |= APR_POLLPRI;
  -                }
  -            }
  -        }
  -    }
  -
  -    return APR_SUCCESS;
  -}
  -
  
  
  
  1.5       +1 -0      apr/poll/os2/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/apr/poll/os2/Makefile.in,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Makefile.in	17 Nov 2003 00:32:36 -0000	1.4
  +++ Makefile.in	22 Nov 2003 01:45:44 -0000	1.5
  @@ -2,6 +2,7 @@
   VPATH = @srcdir@
   
   TARGETS = \
  +	poll.lo \
   	pollset.lo \
   	pollacc.lo
   
  
  
  
  1.7       +0 -0      apr/poll/os2/poll.c
  
  
  
  

Mime
View raw message