aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/isc
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2006-03-21 15:37:16 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2006-03-21 15:37:16 +0000
commitab96eeabe8f319206346df2f486e01caabbfd8f4 (patch)
tree6a044a277848f8d42cf8a314d701efea03241963 /lib/libc/isc
parent03970c5728f7f53ce03efacc0cf12ef383d7cdda (diff)
downloadsrc-ab96eeabe8f319206346df2f486e01caabbfd8f4.tar.gz
src-ab96eeabe8f319206346df2f486e01caabbfd8f4.zip
- Merge our local changes.
- Exclude unnecessary functions for us.
Notes
Notes: svn path=/head/; revision=156956
Diffstat (limited to 'lib/libc/isc')
-rw-r--r--lib/libc/isc/Makefile.inc6
-rw-r--r--lib/libc/isc/ev_streams.c10
-rw-r--r--lib/libc/isc/ev_timers.c16
-rw-r--r--lib/libc/isc/eventlib_p.h9
4 files changed, 40 insertions, 1 deletions
diff --git a/lib/libc/isc/Makefile.inc b/lib/libc/isc/Makefile.inc
new file mode 100644
index 000000000000..48c90f7f66e6
--- /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 64e88b0c00d6..4ad82cf7f35a 100644
--- a/lib/libc/isc/ev_streams.c
+++ b/lib/libc/isc/ev_streams.c
@@ -22,9 +22,13 @@
#if !defined(LINT) && !defined(CODECENTER)
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.2.206.2 2004/03/17 00:29:51 m
#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,3 +313,4 @@ readable(evContext opaqueCtx, void *uap, int fd, int evmask) {
if (str->ioDone <= 0 || str->ioDone == str->ioTotal)
done(opaqueCtx, str);
}
+#endif
diff --git a/lib/libc/isc/ev_timers.c b/lib/libc/isc/ev_timers.c
index 11433fbffa2f..47c3dcf7166d 100644
--- a/lib/libc/isc/ev_timers.c
+++ b/lib/libc/isc/ev_timers.c
@@ -22,15 +22,21 @@
#if !defined(LINT) && !defined(CODECENTER)
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.2.2.1.4.5 2004/03/17 02:39:13
/* 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,3 +510,4 @@ idle_timeout(evContext opaqueCtx,
this->timer->inter = evSubTime(this->max_idle, idle);
}
}
+#endif
diff --git a/lib/libc/isc/eventlib_p.h b/lib/libc/isc/eventlib_p.h
index b95741d7aff3..38b1852e431c 100644
--- a/lib/libc/isc/eventlib_p.h
+++ b/lib/libc/isc/eventlib_p.h
@@ -19,6 +19,7 @@
* vix 09sep95 [initial]
*
* $Id: eventlib_p.h,v 1.3.2.1.4.3 2005/07/28 07:43:20 marka Exp $
+ * $FreeBSD$
*/
#ifndef _EVENTLIB_P_H
@@ -38,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)
@@ -83,6 +86,7 @@ typedef struct evConn {
struct evConn * next;
} evConn;
+#ifndef _LIBC
typedef struct evAccept {
int fd;
union {
@@ -172,6 +176,7 @@ typedef struct evEvent_p {
struct { const void *placeholder; } null;
} u;
} evEvent_p;
+#endif
#ifdef USE_POLL
typedef struct {
@@ -207,6 +212,7 @@ extern void __fd_set(int fd, __evEmulMask *maskp);
#endif /* USE_POLL */
+#ifndef _LIBC
typedef struct {
/* Global. */
const evEvent_p *cur;
@@ -271,6 +277,7 @@ void evDestroyTimers(const evContext_p *);
/* ev_waits.c */
#define evFreeWait __evFreeWait
evWait *evFreeWait(evContext_p *ctx, evWait *old);
+#endif
/* Global options */
extern int __evOptMonoTime;