diff --git a/config-unix.mk b/config-unix.mk index 9524061b..8fe7254c 100644 --- a/config-unix.mk +++ b/config-unix.mk @@ -74,6 +74,15 @@ OBJS += src/unix/freebsd.o OBJS += src/unix/kqueue.o endif +ifeq (DragonFly,$(uname_S)) +EV_CONFIG=config_freebsd.h +EIO_CONFIG=config_freebsd.h +CPPFLAGS += -Isrc/ares/config_freebsd +LINKFLAGS+= +OBJS += src/unix/freebsd.o +OBJS += src/unix/kqueue.o +endif + ifeq (NetBSD,$(uname_S)) EV_CONFIG=config_netbsd.h EIO_CONFIG=config_netbsd.h diff --git a/src/unix/eio/eio.c b/src/unix/eio/eio.c index 23740061..75abd9bb 100644 --- a/src/unix/eio/eio.c +++ b/src/unix/eio/eio.c @@ -316,7 +316,7 @@ static int gettimeofday(struct timeval *tv, struct timezone *tz) #if HAVE_SENDFILE # if __linux # include -# elif __FreeBSD__ || defined __APPLE__ +# elif __FreeBSD__ || __DragonFly__ || defined __APPLE__ # include # include # elif __hpux diff --git a/src/unix/freebsd.c b/src/unix/freebsd.c index 7c5deabb..a519f86d 100644 --- a/src/unix/freebsd.c +++ b/src/unix/freebsd.c @@ -50,11 +50,17 @@ int uv_exepath(char* buffer, size_t* size) { return -1; } - +#ifdef __DragonFly__ + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_ARGS; + mib[3] = getpid(); +#else mib[0] = CTL_KERN; mib[1] = KERN_PROC; mib[2] = KERN_PROC_PATHNAME; mib[3] = -1; +#endif cb = *size; if (sysctl(mib, 4, buffer, &cb, NULL, 0) < 0) {