diff options
Diffstat (limited to 'lib/libc/isc')
-rw-r--r-- | lib/libc/isc/Makefile.inc | 6 | ||||
-rw-r--r-- | lib/libc/isc/ev_streams.c | 14 | ||||
-rw-r--r-- | lib/libc/isc/ev_timers.c | 20 | ||||
-rw-r--r-- | lib/libc/isc/eventlib_p.h | 26 |
4 files changed, 51 insertions, 15 deletions
diff --git a/lib/libc/isc/Makefile.inc b/lib/libc/isc/Makefile.inc new file mode 100644 index 0000000..48c90f7 --- /dev/null +++ b/lib/libc/isc/Makefile.inc @@ -0,0 +1,6 @@ +# $FreeBSD$ + +# isc sources +.PATH: ${.CURDIR}/isc + +SRCS+= ev_streams.c ev_timers.c diff --git a/lib/libc/isc/ev_streams.c b/lib/libc/isc/ev_streams.c index ab61246..4ad82cf 100644 --- a/lib/libc/isc/ev_streams.c +++ b/lib/libc/isc/ev_streams.c @@ -20,11 +20,15 @@ */ #if !defined(LINT) && !defined(CODECENTER) -static const char rcsid[] = "$Id: ev_streams.c,v 1.4.18.1 2005/04/27 05:01:06 sra Exp $"; +static const char rcsid[] = "$Id: ev_streams.c,v 1.2.206.2 2004/03/17 00:29:51 marka Exp $"; #endif +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); #include "port_before.h" +#ifndef _LIBC #include "fd_setsize.h" +#endif #include <sys/types.h> #include <sys/uio.h> @@ -32,16 +36,20 @@ static const char rcsid[] = "$Id: ev_streams.c,v 1.4.18.1 2005/04/27 05:01:06 sr #include <errno.h> #include <isc/eventlib.h> +#ifndef _LIBC #include <isc/assertions.h> +#endif #include "eventlib_p.h" #include "port_after.h" +#ifndef _LIBC static int copyvec(evStream *str, const struct iovec *iov, int iocnt); static void consume(evStream *str, size_t bytes); static void done(evContext opaqueCtx, evStream *str); static void writable(evContext opaqueCtx, void *uap, int fd, int evmask); static void readable(evContext opaqueCtx, void *uap, int fd, int evmask); +#endif struct iovec evConsIovec(void *buf, size_t cnt) { @@ -53,6 +61,7 @@ evConsIovec(void *buf, size_t cnt) { return (ret); } +#ifndef _LIBC int evWrite(evContext opaqueCtx, int fd, const struct iovec *iov, int iocnt, evStreamFunc func, void *uap, evStreamID *id) @@ -304,5 +313,4 @@ readable(evContext opaqueCtx, void *uap, int fd, int evmask) { if (str->ioDone <= 0 || str->ioDone == str->ioTotal) done(opaqueCtx, str); } - -/*! \file */ +#endif diff --git a/lib/libc/isc/ev_timers.c b/lib/libc/isc/ev_timers.c index cead2aa..47c3dcf 100644 --- a/lib/libc/isc/ev_timers.c +++ b/lib/libc/isc/ev_timers.c @@ -20,17 +20,23 @@ */ #if !defined(LINT) && !defined(CODECENTER) -static const char rcsid[] = "$Id: ev_timers.c,v 1.5.18.1 2005/04/27 05:01:06 sra Exp $"; +static const char rcsid[] = "$Id: ev_timers.c,v 1.2.2.1.4.5 2004/03/17 02:39:13 marka Exp $"; #endif +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); /* Import. */ #include "port_before.h" +#ifndef _LIBC #include "fd_setsize.h" +#endif #include <errno.h> +#ifndef _LIBC #include <isc/assertions.h> +#endif #include <isc/eventlib.h> #include "eventlib_p.h" @@ -43,6 +49,9 @@ static const char rcsid[] = "$Id: ev_timers.c,v 1.5.18.1 2005/04/27 05:01:06 sra /* Forward. */ +#ifdef _LIBC +static int __evOptMonoTime; +#else static int due_sooner(void *, void *); static void set_index(void *, int); static void free_timer(void *, void *); @@ -58,6 +67,7 @@ typedef struct { struct timespec max_idle; evTimer * timer; } idle_timer; +#endif /* Public. */ @@ -138,12 +148,14 @@ evUTCTime() { return (evTimeSpec(now)); } +#ifndef _LIBC struct timespec evLastEventTime(evContext opaqueCtx) { evContext_p *ctx = opaqueCtx.opaque; return (ctx->lastEventTime); } +#endif struct timespec evTimeSpec(struct timeval tv) { @@ -154,6 +166,7 @@ evTimeSpec(struct timeval tv) { return (ts); } +#if !defined(USE_KQUEUE) || !defined(_LIBC) struct timeval evTimeVal(struct timespec ts) { struct timeval tv; @@ -162,7 +175,9 @@ evTimeVal(struct timespec ts) { tv.tv_usec = ts.tv_nsec / 1000; return (tv); } +#endif +#ifndef _LIBC int evSetTimer(evContext opaqueCtx, evTimerFunc func, @@ -495,5 +510,4 @@ idle_timeout(evContext opaqueCtx, this->timer->inter = evSubTime(this->max_idle, idle); } } - -/*! \file */ +#endif diff --git a/lib/libc/isc/eventlib_p.h b/lib/libc/isc/eventlib_p.h index 5896553..256279e 100644 --- a/lib/libc/isc/eventlib_p.h +++ b/lib/libc/isc/eventlib_p.h @@ -15,11 +15,11 @@ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/*! \file - * \brief private interfaces for eventlib - * \author vix 09sep95 [initial] +/* eventlib_p.h - private interfaces for eventlib + * vix 09sep95 [initial] * - * $Id: eventlib_p.h,v 1.5.18.4 2006/03/10 00:20:08 marka Exp $ + * $Id: eventlib_p.h,v 1.3.2.1.4.4 2006/03/10 00:17:21 marka Exp $ + * $FreeBSD$ */ #ifndef _EVENTLIB_P_H @@ -39,9 +39,11 @@ #include <stdlib.h> #include <string.h> -#include <isc/heap.h> +#ifndef _LIBC #include <isc/list.h> +#include <isc/heap.h> #include <isc/memcluster.h> +#endif #define EV_MASK_ALL (EV_READ | EV_WRITE | EV_EXCEPT) #define EV_ERR(e) return (errno = (e), -1) @@ -78,14 +80,15 @@ typedef struct evConn { void * uap; int fd; int flags; -#define EV_CONN_LISTEN 0x0001 /*%< Connection is a listener. */ -#define EV_CONN_SELECTED 0x0002 /*%< evSelectFD(conn->file). */ -#define EV_CONN_BLOCK 0x0004 /*%< Listener fd was blocking. */ +#define EV_CONN_LISTEN 0x0001 /* Connection is a listener. */ +#define EV_CONN_SELECTED 0x0002 /* evSelectFD(conn->file). */ +#define EV_CONN_BLOCK 0x0004 /* Listener fd was blocking. */ evFileID file; struct evConn * prev; struct evConn * next; } evConn; +#ifndef _LIBC typedef struct evAccept { int fd; union { @@ -127,7 +130,7 @@ typedef struct evStream { evFileID file; evTimerID timer; int flags; -#define EV_STR_TIMEROK 0x0001 /*%< IFF timer valid. */ +#define EV_STR_TIMEROK 0x0001 /* IFF timer valid. */ int fd; struct iovec * iovOrig; int iovOrigCount; @@ -175,6 +178,7 @@ typedef struct evEvent_p { struct { const void *placeholder; } null; } u; } evEvent_p; +#endif #ifdef USE_POLL typedef struct { @@ -210,6 +214,7 @@ extern void __fd_set(int fd, __evEmulMask *maskp); #endif /* USE_POLL */ +#ifndef _LIBC typedef struct { /* Global. */ const evEvent_p *cur; @@ -274,8 +279,11 @@ void evDestroyTimers(const evContext_p *); /* ev_waits.c */ #define evFreeWait __evFreeWait evWait *evFreeWait(evContext_p *ctx, evWait *old); +#endif /* Global options */ +#ifndef _LIBC extern int __evOptMonoTime; +#endif #endif /*_EVENTLIB_P_H*/ |