Add support for DragonFly BSD by sharing code for FreeBSD.
This commit is contained in:
parent
93faeb2189
commit
89ea3be6c2
@ -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
|
||||
|
||||
@ -316,7 +316,7 @@ static int gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||
#if HAVE_SENDFILE
|
||||
# if __linux
|
||||
# include <sys/sendfile.h>
|
||||
# elif __FreeBSD__ || defined __APPLE__
|
||||
# elif __FreeBSD__ || __DragonFly__ || defined __APPLE__
|
||||
# include <sys/socket.h>
|
||||
# include <sys/uio.h>
|
||||
# elif __hpux
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user