/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* ev_streams.c - implement asynch stream file IO for the eventlib
* vix 04mar96 [initial]
*/
#if !defined(LINT) && !defined(CODECENTER)
#endif
#include "port_before.h"
#include "fd_setsize.h"
#include <errno.h>
#include <isc/eventlib.h>
#include <isc/assertions.h>
#include "eventlib_p.h"
#include "port_after.h"
struct iovec
return (ret);
}
int
{
int save;
goto free;
goto free;
return (0);
free:
return (-1);
}
int
{
int save;
goto free;
goto free;
if (id)
return (0);
free:
return (-1);
}
int
return (0);
}
int
return (0);
}
int
/*
* The streams list is doubly threaded. First, there's ctx->streams
* that's used by evDestroy() to find and cancel all streams. Second,
* there's ctx->strDone (head) and ctx->strLast (tail) which thread
* through the potentially smaller number of "IO completed" streams,
* used in evGetNext() to avoid scanning the entire list.
*/
/* Unlink from ctx->streams. */
else
/*
* If 'old' is on the ctx->strDone list, remove it. Update
* ctx->strLast if necessary.
*/
/*
* Either 'old' is the only item on the done list, or it's
* not on the done list. If the former, then we unlink it
* from the list. If the latter, we leave the list alone.
*/
}
} else {
else
else
}
/* Deallocate the stream. */
return (0);
}
static int
int i;
return (-1);
}
for (i = 0; i < iocnt; i++) {
}
return (0);
}
/* Pull off or truncate lead iovec(s). */
static void
while (bytes > 0U) {
bytes = 0;
} else {
str->iovCurCount--;
}
}
}
/* Add a stream to Done list and deselect the FD. */
static void
} else {
}
/* evDrop() will call evCancelRW() on us. */
}
/* Dribble out some bytes on the stream. (Called by evDispatch().) */
static void
int bytes;
if (bytes > 0) {
} else {
}
}
}
/* Scoop up some bytes from the stream. (Called by evDispatch().) */
static void
int bytes;
if (bytes > 0) {
} else {
if (bytes == 0)
else {
}
}
}
}
/*! \file */