brianp 2002/08/03 21:43:23
Modified: include apr_poll.h
poll/unix poll.c
test testpoll.c
Log:
One more update to the pollset API before we start using it
in the httpd: add a "flags" argument to apr_pollset_create().
When we add support for OS-specific poll alternatives in the
future, I anticipate that we'll need to give apps a way to
pass hints to the pollset create function to help it pick
the best mechanism for a specific pollset. (E.g., there may
be situations where we'll want to use poll(2) even if the OS
has /dev/poll.) This "flags" argument is a placeholder to
make it possible to add such hints later.
Revision Changes Path
1.5 +4 -1 apr/include/apr_poll.h
Index: apr_poll.h
===================================================================
RCS file: /home/cvs/apr/include/apr_poll.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- apr_poll.h 2 Aug 2002 19:43:34 -0000 1.4
+++ apr_poll.h 4 Aug 2002 04:43:23 -0000 1.5
@@ -231,10 +231,13 @@
* @param pollset The pointer in which to return the newly created object
* @param size The maximum number of descriptors that this pollset can hold
* @param p The pool from which to allocate the pollset
+ * @param flags Optional flags to modify the operation of the pollset
+ * (reserved for future expansion)
*/
APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset,
apr_uint32_t size,
- apr_pool_t *p);
+ apr_pool_t *p,
+ apr_uint32_t flags);
/**
* Destroy a pollset object
1.26 +2 -1 apr/poll/unix/poll.c
Index: poll.c
===================================================================
RCS file: /home/cvs/apr/poll/unix/poll.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- poll.c 4 Aug 2002 01:35:45 -0000 1.25
+++ poll.c 4 Aug 2002 04:43:23 -0000 1.26
@@ -323,7 +323,8 @@
APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset,
apr_uint32_t size,
- apr_pool_t *p)
+ apr_pool_t *p,
+ apr_uint32_t flags)
{
#if !defined(HAVE_POLL) && defined(FD_SETSIZE)
if (size > FD_SETSIZE) {
1.18 +1 -1 apr/test/testpoll.c
Index: testpoll.c
===================================================================
RCS file: /home/cvs/apr/test/testpoll.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- testpoll.c 3 Aug 2002 00:10:57 -0000 1.17
+++ testpoll.c 4 Aug 2002 04:43:23 -0000 1.18
@@ -246,7 +246,7 @@
fprintf (stdout,"\nAPR Pollset Test\n****************\n\n");
printf ("\tSetting up pollset....................");
- if (apr_pollset_create(&pollset, LARGE_NUM_SOCKETS, context) !=
APR_SUCCESS){
+ if (apr_pollset_create(&pollset, LARGE_NUM_SOCKETS, context, 0) !=
APR_SUCCESS){
printf("Couldn't create a pollset!\n");
exit (-1);
}