Skip to content

Commit

Permalink
uv: Upgrade to v0.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Apr 12, 2013
1 parent 259839f commit 061151c
Show file tree
Hide file tree
Showing 31 changed files with 369 additions and 142 deletions.
3 changes: 3 additions & 0 deletions deps/uv/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ vgcore.*
/libuv.so
/libuv.dylib

# Generated by dtrace(1) when doing an in-tree build.
/src/unix/uv-dtrace.h

/out/
/build/gyp

Expand Down
5 changes: 5 additions & 0 deletions deps/uv/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,8 @@ Tim Bradshaw <tfb@cley.com>
Timothy J. Fontaine <tjfontaine@gmail.com>
Marc Schlaich <marc.schlaich@googlemail.com>
Brian Mazza <louseman@gmail.com>
Elliot Saba <staticfloat@gmail.com>
Ben Kelly <ben@wanderview.com>
Kristian Evensen <kristian.evensen@gmail.com>
Nils Maier <maierman@web.de>
Nicholas Vavilov <vvnicholas@gmail.com>
38 changes: 38 additions & 0 deletions deps/uv/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
2013.04.11, Version 0.11.1 (Unstable)

This is the first versioned release from the current unstable libuv branch.

Changes since Node.js v0.11.0:

* all platforms: nanosecond resolution support for uv_fs_[fl]stat (Timothy J.
Fontaine)

* all platforms: add netmask to uv_interface_address (Ben Kelly)

* unix: make sure the `status` parameter passed to the `uv_getaddrinfo` is 0 or
-1 (Ben Noordhuis)

* unix: limit the number of iovecs written in a single `writev` syscall to
IOV_MAX (Fedor Indutny)

* unix: add dtrace probes for tick-start and tick-stop (Timothy J. Fontaine)

* mingw-w64: don't call _set_invalid_parameter_handler (Nils Maier)

* windows: fix memory leak in fs__sendfile (Shannen Saez)

* windows: fix edge case bugs in uv_cpu_info (Bert Belder)

* include: no longer ship with / include ngx-queue.h (Ben Noordhuis)

* include: remove UV_VERSION_* macros from uv.h (Ben Noordhuis)

* documentation updates (Kristian Evensen, Ben Kelly, Ben Noordhuis)

* build: fix dtrace-enabled builds (Ben Noordhuis, Timothy J. Fontaine)

* build: gyp disable thin archives (Timothy J. Fontaine)

* build: add support for Visual Studio 2012 (Nicholas Vavilov)


2013.02.04, Version 0.10.3 (Stable)

Changes since version 0.10.2:
Expand Down
6 changes: 5 additions & 1 deletion deps/uv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,14 @@ autotools, add a `AC_GNU_SOURCE` declaration to your `configure.ac`.
## Supported Platforms

Microsoft Windows operating systems since Windows XP SP2. It can be built
with either Visual Studio or MinGW.
with either Visual Studio or MinGW. Consider using
[Visual Studio Express 2010][] or later if you do not have a full Visual
Studio license.

Linux 2.6 using the GCC toolchain.

MacOS using the GCC or XCode toolchain.

Solaris 121 and later using GCC toolchain.

[Visual Studio Express 2010]: http://www.microsoft.com/visualstudio/eng/products/visual-studio-2010-express
2 changes: 1 addition & 1 deletion deps/uv/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,5 @@ bench: run-benchmarks$(E)
clean distclean: clean-platform
$(RM) libuv.a libuv.$(SOEXT) \
test/run-tests.o test/run-benchmarks.o \
test/run-tests$(E) test/run-benchmarks$(E) \
test/runner.o run-tests$(E) test/run-benchmarks$(E) \
$(BENCHMARKS) $(TESTS) $(RUNNER_LIBS)
10 changes: 10 additions & 0 deletions deps/uv/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
'cflags': [ '-Wall' ],
'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
'target_conditions': [
['_type=="static_library"', {
'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
}],
],
'conditions': [
[ 'host_arch != target_arch and target_arch=="ia32"', {
'cflags': [ '-m32' ],
Expand Down Expand Up @@ -192,6 +197,11 @@
}],
],
}],
['OS=="solaris"', {
'cflags': [ '-fno-omit-frame-pointer' ],
# pull in V8's postmortem metadata
'ldflags': [ '-Wl,-z,allextract' ]
}],
],
},
}
30 changes: 28 additions & 2 deletions deps/uv/config-unix.mk
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ RUNNER_SRC=test/runner-unix.c
RUNNER_CFLAGS=$(CFLAGS) -I$(SRCDIR)/test
RUNNER_LDFLAGS=-L"$(CURDIR)" -luv -Xlinker -rpath -Xlinker "$(CURDIR)"

HAVE_DTRACE=
DTRACE_OBJS=
DTRACE_HEADER=

OBJS += src/unix/async.o
OBJS += src/unix/core.o
OBJS += src/unix/dl.o
Expand All @@ -58,11 +62,14 @@ OBJS += src/inet.o
OBJS += src/version.o

ifeq (sunos,$(PLATFORM))
HAVE_DTRACE=1
CPPFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
LDFLAGS+=-lkstat -lnsl -lsendfile -lsocket
# Library dependencies are not transitive.
RUNNER_LDFLAGS += $(LDFLAGS)
OBJS += src/unix/sunos.o
OBJS += src/unix/dtrace.o
DTRACE_OBJS += src/unix/core.o
endif

ifeq (aix,$(PLATFORM))
Expand All @@ -72,6 +79,9 @@ OBJS += src/unix/aix.o
endif

ifeq (darwin,$(PLATFORM))
HAVE_DTRACE=1
# dtrace(1) probes contain dollar signs.
CFLAGS += -Wno-dollar-in-identifier-extension
CPPFLAGS += -D_DARWIN_USE_64_BIT_INODE=1
LDFLAGS += -framework Foundation \
-framework CoreServices \
Expand All @@ -96,6 +106,7 @@ OBJS += src/unix/linux-core.o \
endif

ifeq (freebsd,$(PLATFORM))
HAVE_DTRACE=1
LDFLAGS+=-lkvm
OBJS += src/unix/freebsd.o
OBJS += src/unix/kqueue.o
Expand Down Expand Up @@ -132,6 +143,12 @@ else
RUNNER_LDFLAGS += -pthread
endif

ifeq ($(HAVE_DTRACE), 1)
DTRACE_HEADER = src/unix/uv-dtrace.h
CPPFLAGS += -Isrc/unix
CFLAGS += -DHAVE_DTRACE
endif

libuv.a: $(OBJS)
$(AR) rcs $@ $^

Expand All @@ -152,7 +169,7 @@ src/.buildstamp src/unix/.buildstamp test/.buildstamp:
mkdir -p $(@D)
touch $@

src/unix/%.o src/unix/%.pic.o: src/unix/%.c include/uv.h include/uv-private/uv-unix.h src/unix/internal.h src/unix/.buildstamp
src/unix/%.o src/unix/%.pic.o: src/unix/%.c include/uv.h include/uv-private/uv-unix.h src/unix/internal.h src/unix/.buildstamp $(DTRACE_HEADER)
$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

src/%.o src/%.pic.o: src/%.c include/uv.h include/uv-private/uv-unix.h src/.buildstamp
Expand All @@ -162,7 +179,16 @@ test/%.o: test/%.c include/uv.h test/.buildstamp
$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

clean-platform:
$(RM) test/run-{tests,benchmarks}.dSYM $(OBJS) $(OBJS:%.o=%.pic.o)
$(RM) test/run-{tests,benchmarks}.dSYM $(OBJS) $(OBJS:%.o=%.pic.o) src/unix/uv-dtrace.h

%.pic.o %.o: %.m
$(OBJC) $(CPPFLAGS) $(CFLAGS) -c $^ -o $@

src/unix/uv-dtrace.h: src/unix/uv-dtrace.d
dtrace -h -xnolibs -s $< -o $@

src/unix/dtrace.o: src/unix/uv-dtrace.d $(DTRACE_OBJS)
dtrace -G -s $^ -o $@

src/unix/dtrace.pic.o: src/unix/uv-dtrace.d $(DTRACE_OBJS:%.o=%.pic.o)
dtrace -G -s $^ -o $@
14 changes: 12 additions & 2 deletions deps/uv/include/uv.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ UV_EXTERN uint64_t uv_now(uv_loop_t*);
* Get backend file descriptor. Only kqueue, epoll and event ports are
* supported.
*
* This can be used in conjunction with uv_run_once() to poll in one thread and
* run the event loop's event callbacks in another.
* This can be used in conjunction with `uv_run(loop, UV_RUN_NOWAIT)` to
* poll in one thread and run the event loop's event callbacks in another.
*
* Useful for embedding libuv's event loop in another event loop.
* See test/test-embed.c for an example.
Expand Down Expand Up @@ -787,6 +787,12 @@ UV_EXTERN int uv_udp_init(uv_loop_t*, uv_udp_t* handle);

/*
* Opens an existing file descriptor or SOCKET as a udp handle.
*
* Unix only:
* The only requirement of the sock argument is that it follows the
* datagram contract (works in unconnected mode, supports sendmsg()/recvmsg(),
* etc.). In other words, other datagram-type sockets like raw sockets or
* netlink sockets can also be passed to this function.
*/
UV_EXTERN int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock);

Expand Down Expand Up @@ -1473,6 +1479,10 @@ struct uv_interface_address_s {
struct sockaddr_in address4;
struct sockaddr_in6 address6;
} address;
union {
struct sockaddr_in netmask4;
struct sockaddr_in6 netmask6;
} netmask;
};

UV_EXTERN char** uv_setup_args(int argc, char** argv);
Expand Down
4 changes: 2 additions & 2 deletions deps/uv/src/inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ uv_err_t uv_inet_ntop(int af, const void* src, char* dst, size_t size) {
static uv_err_t inet_ntop4(const unsigned char *src, char *dst, size_t size) {
static const char fmt[] = "%u.%u.%u.%u";
char tmp[sizeof "255.255.255.255"];
size_t l;
int l;

#ifndef _WIN32
l = snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]);
#else
l = _snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]);
#endif
if (l <= 0 || l >= size) {
if (l <= 0 || (size_t) l >= size) {
return uv_enospc_;
}
strncpy(dst, tmp, size);
Expand Down
8 changes: 4 additions & 4 deletions deps/uv/src/unix/aix.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ uint64_t uv__hrtime(void) {
int uv_exepath(char* buffer, size_t* size) {
ssize_t res;
char pp[64], cwdl[PATH_MAX];
size_t cwdl_len;
struct psinfo ps;
int fd;

Expand All @@ -79,7 +78,6 @@ int uv_exepath(char* buffer, size_t* size) {
return res;

cwdl[res] = '\0';
cwdl_len = res;

(void) snprintf(pp, sizeof(pp), "/proc/%lu/psinfo", (unsigned long) getpid());
fd = open(pp, O_RDONLY);
Expand Down Expand Up @@ -364,11 +362,13 @@ uv_err_t uv_interface_addresses(uv_interface_address_t** addresses,
address->name = strdup(p->ifr_name);

if (p->ifr_addr.sa_family == AF_INET6) {
address->address.address6 = *((struct sockaddr_in6 *)&p->ifr_addr);
address->address.address6 = *((struct sockaddr_in6*) &p->ifr_addr);
} else {
address->address.address4 = *((struct sockaddr_in *)&p->ifr_addr);
address->address.address4 = *((struct sockaddr_in*) &p->ifr_addr);
}

/* TODO: Retrieve netmask using SIOCGIFNETMASK ioctl */

address->is_internal = flg.ifr_flags & IFF_LOOPBACK ? 1 : 0;

address++;
Expand Down
4 changes: 4 additions & 0 deletions deps/uv/src/unix/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ int uv_run(uv_loop_t* loop, uv_run_mode mode) {

r = uv__loop_alive(loop);
while (r != 0 && loop->stop_flag == 0) {
UV_TICK_START(loop, mode);

uv__update_time(loop);
uv__run_timers(loop);
uv__run_idle(loop);
Expand All @@ -314,6 +316,8 @@ int uv_run(uv_loop_t* loop, uv_run_mode mode) {
uv__run_closing_handles(loop);
r = uv__loop_alive(loop);

UV_TICK_STOP(loop, mode);

if (mode & (UV_RUN_ONCE | UV_RUN_NOWAIT))
break;
}
Expand Down
3 changes: 0 additions & 3 deletions deps/uv/src/unix/cygwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ void uv_loadavg(double avg[3]) {

int uv_exepath(char* buffer, size_t* size) {
uint32_t usize;
int result;
char* path;
char* fullpath;

if (!buffer || !size) {
return -1;
Expand Down
10 changes: 8 additions & 2 deletions deps/uv/src/unix/darwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,15 @@ uv_err_t uv_interface_addresses(uv_interface_address_t** addresses,
address->name = strdup(ent->ifa_name);

if (ent->ifa_addr->sa_family == AF_INET6) {
address->address.address6 = *((struct sockaddr_in6 *)ent->ifa_addr);
address->address.address6 = *((struct sockaddr_in6*) ent->ifa_addr);
} else {
address->address.address4 = *((struct sockaddr_in *)ent->ifa_addr);
address->address.address4 = *((struct sockaddr_in*) ent->ifa_addr);
}

if (ent->ifa_netmask->sa_family == AF_INET6) {
address->netmask.netmask6 = *((struct sockaddr_in6*) ent->ifa_netmask);
} else {
address->netmask.netmask4 = *((struct sockaddr_in*) ent->ifa_netmask);
}

address->is_internal = ent->ifa_flags & IFF_LOOPBACK ? 1 : 0;
Expand Down
5 changes: 3 additions & 2 deletions deps/uv/src/unix/getaddrinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ static void uv__getaddrinfo_done(struct uv__work* w, int status) {
#if defined(EAI_NODATA) /* Newer FreeBSDs don't have EAI_NODATA. */
else if (req->retcode == EAI_NODATA)
uv__set_sys_error(req->loop, ENOENT);
#elif defined(__sun)
if (req->retcode == EAI_MEMORY && hostlen >= MAXHOSTNAMELEN) {
#endif
#if defined(__sun)
else if (req->retcode == EAI_MEMORY && hostlen >= MAXHOSTNAMELEN)
uv__set_sys_error(req->loop, ENOENT);
#endif
else {
Expand Down
7 changes: 7 additions & 0 deletions deps/uv/src/unix/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,11 @@ static void uv__update_time(uv_loop_t* loop) {
loop->time = uv__hrtime() / 1000000;
}

#ifdef HAVE_DTRACE
#include "uv-dtrace.h"
#else
#define UV_TICK_START(arg0, arg1)
#define UV_TICK_STOP(arg0, arg1)
#endif

#endif /* UV_UNIX_INTERNAL_H_ */
10 changes: 8 additions & 2 deletions deps/uv/src/unix/linux-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,15 @@ uv_err_t uv_interface_addresses(uv_interface_address_t** addresses,
address->name = strdup(ent->ifa_name);

if (ent->ifa_addr->sa_family == AF_INET6) {
address->address.address6 = *((struct sockaddr_in6 *)ent->ifa_addr);
address->address.address6 = *((struct sockaddr_in6*) ent->ifa_addr);
} else {
address->address.address4 = *((struct sockaddr_in *)ent->ifa_addr);
address->address.address4 = *((struct sockaddr_in*) ent->ifa_addr);
}

if (ent->ifa_netmask->sa_family == AF_INET6) {
address->netmask.netmask6 = *((struct sockaddr_in6*) ent->ifa_netmask);
} else {
address->netmask.netmask4 = *((struct sockaddr_in*) ent->ifa_netmask);
}

address->is_internal = ent->ifa_flags & IFF_LOOPBACK ? 1 : 0;
Expand Down
10 changes: 8 additions & 2 deletions deps/uv/src/unix/netbsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,15 @@ uv_err_t uv_interface_addresses(uv_interface_address_t** addresses, int* count)
address->name = strdup(ent->ifa_name);

if (ent->ifa_addr->sa_family == AF_INET6) {
address->address.address6 = *((struct sockaddr_in6 *)ent->ifa_addr);
address->address.address6 = *((struct sockaddr_in6*) ent->ifa_addr);
} else {
address->address.address4 = *((struct sockaddr_in *)ent->ifa_addr);
address->address.address4 = *((struct sockaddr_in*) ent->ifa_addr);
}

if (ent->ifa_netmask->sa_family == AF_INET6) {
address->netmask.netmask6 = *((struct sockaddr_in6*) ent->ifa_netmask);
} else {
address->netmask.netmask4 = *((struct sockaddr_in*) ent->ifa_netmask);
}

address->is_internal = !!(ent->ifa_flags & IFF_LOOPBACK) ? 1 : 0;
Expand Down
Loading

0 comments on commit 061151c

Please sign in to comment.