Skip to content

Commit

Permalink
deps: upgrade libuv to 1.11.0
Browse files Browse the repository at this point in the history
Fixes: #10165
Fixes: #9856
Fixes: #10607
Fixes: #11104
PR-URL: #11094
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
cjihrig authored and MylesBorins committed May 18, 2017
1 parent a3a4b69 commit a12cdf0
Show file tree
Hide file tree
Showing 38 changed files with 1,589 additions and 198 deletions.
1 change: 1 addition & 0 deletions deps/uv/.mailmap
@@ -1,6 +1,7 @@
Aaron Bieber <qbit@deftly.net> <deftly@gmail.com>
Alan Gutierrez <alan@prettyrobots.com> <alan@blogometer.com>
Andrius Bentkus <andrius.bentkus@gmail.com> <toxedvirus@gmail.com>
Bert Belder <bertbelder@gmail.com> <i@bertbelder.com>
Bert Belder <bertbelder@gmail.com> <info@2bs.nl>
Bert Belder <bertbelder@gmail.com> <user@ChrUbuntu.(none)>
Brandon Philips <brandon.philips@rackspace.com> <brandon@ifup.org>
Expand Down
5 changes: 5 additions & 0 deletions deps/uv/AUTHORS
Expand Up @@ -279,3 +279,8 @@ Philippe Laferriere <laferriere.phil@gmail.com>
Will Speak <lithiumflame@gmail.com>
Hitesh Kanwathirtha <digitalinfinity@gmail.com>
Eric Sciple <ersciple@microsoft.com>
jBarz <jBarz@users.noreply.github.com>
muflub <admin@lodle.net>
Daniel Bevenius <daniel.bevenius@gmail.com>
Howard Hellyer <hhellyer@uk.ibm.com>
Chris Araman <chris.araman@fuze.com>
39 changes: 39 additions & 0 deletions deps/uv/ChangeLog
@@ -1,3 +1,42 @@
2017.02.02, Version 1.11.0 (Stable), 7452ef4e06a4f99ee26b694c65476401534f2725

Changes since version 1.10.2:

* Now working on version 1.10.3 (cjihrig)

* win: added fcntl.h to uv-win.h (Michele Caini)

* unix: move function call out of assert (jBarz)

* fs: cleanup uv__fs_scandir (Santiago Gimeno)

* fs: fix crash in uv_fs_scandir_next (muflub)

* win,signal: fix potential deadlock (Bartosz Sosnowski)

* unix: use async-signal safe functions between fork and exec (jBarz)

* sunos: fix SUNOS_NO_IFADDRS build (Ben Noordhuis)

* zos: make platform functional (John Barboza)

* doc: add repitition qualifier to version regexs (Daniel Bevenius)

* zos: use gyp OS label "os390" on z/OS (John Barboza)

* aix: enable uv_get/set_process_title (Howard Hellyer)

* zos: use built-in proctitle implementation (John Barboza)

* Revert "darwin: use clock_gettime in macOS 10.12" (Chris Araman)

* win,test: don't write uninitialized buffer to tty (Bert Belder)

* win: define ERROR_ELEVATION_REQUIRED for MinGW (Richard Lau)

* aix: re-enable fs watch facility (Gireesh Punathil)


2017.01.10, Version 1.10.2 (Stable), cb9f579a454b8db592030ffa274ae58df78dbe20

Changes since version 1.10.1:
Expand Down
12 changes: 9 additions & 3 deletions deps/uv/Makefile.am
Expand Up @@ -316,7 +316,11 @@ test_run_tests_CFLAGS += -D_UNIX03_THREADS \
endif

if AIX
libuv_la_CFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500 -D_LINUX_SOURCE_COMPAT -D_THREAD_SAFE
libuv_la_CFLAGS += -D_ALL_SOURCE \
-D_XOPEN_SOURCE=500 \
-D_LINUX_SOURCE_COMPAT \
-D_THREAD_SAFE \
-DHAVE_SYS_AHAFS_EVPRODS_H
include_HEADERS += include/uv-aix.h
libuv_la_SOURCES += src/unix/aix.c
endif
Expand Down Expand Up @@ -402,8 +406,10 @@ libuv_la_CFLAGS += -D_UNIX03_THREADS \
-qFLOAT=IEEE
libuv_la_LDFLAGS += -qXPLINK
libuv_la_SOURCES += src/unix/pthread-fixes.c \
src/unix/pthread-barrier.c
libuv_la_SOURCES += src/unix/os390.c
src/unix/pthread-barrier.c \
src/unix/os390.c \
src/unix/os390-syscalls.c \
src/unix/proctitle.c
endif

if HAVE_PKG_CONFIG
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/appveyor.yml
@@ -1,4 +1,4 @@
version: v1.10.2.build{build}
version: v1.11.0.build{build}

install:
- cinst -y nsis
Expand Down
4 changes: 2 additions & 2 deletions deps/uv/common.gypi
Expand Up @@ -35,7 +35,7 @@
'OTHER_CFLAGS': [ '-Wno-strict-aliasing' ],
},
'conditions': [
['OS != "zos"', {
['OS != "os390"', {
'cflags': [ '-O0', '-fwrapv' ]
}],
['OS == "android"', {
Expand Down Expand Up @@ -154,7 +154,7 @@
'cflags': [ '-pthreads' ],
'ldflags': [ '-pthreads' ],
}],
[ 'OS not in "solaris android zos"', {
[ 'OS not in "solaris android os390"', {
'cflags': [ '-pthread' ],
'ldflags': [ '-pthread' ],
}],
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/configure.ac
Expand Up @@ -13,7 +13,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

AC_PREREQ(2.57)
AC_INIT([libuv], [1.10.2], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.11.0], [https://github.com/libuv/libuv/issues])
AC_CONFIG_MACRO_DIR([m4])
m4_include([m4/libuv-extra-automake-flags.m4])
m4_include([m4/as_case.m4])
Expand Down
6 changes: 3 additions & 3 deletions deps/uv/docs/src/conf.py
Expand Up @@ -21,11 +21,11 @@ def get_libuv_version():
with open('../../include/uv-version.h') as f:
data = f.read()
try:
m = re.search(r"""^#define UV_VERSION_MAJOR (\d)$""", data, re.MULTILINE)
m = re.search(r"""^#define UV_VERSION_MAJOR (\d+)$""", data, re.MULTILINE)
major = int(m.group(1))
m = re.search(r"""^#define UV_VERSION_MINOR (\d)$""", data, re.MULTILINE)
m = re.search(r"""^#define UV_VERSION_MINOR (\d+)$""", data, re.MULTILINE)
minor = int(m.group(1))
m = re.search(r"""^#define UV_VERSION_PATCH (\d)$""", data, re.MULTILINE)
m = re.search(r"""^#define UV_VERSION_PATCH (\d+)$""", data, re.MULTILINE)
patch = int(m.group(1))
m = re.search(r"""^#define UV_VERSION_IS_RELEASE (\d)$""", data, re.MULTILINE)
is_release = int(m.group(1))
Expand Down
6 changes: 5 additions & 1 deletion deps/uv/docs/src/misc.rst
Expand Up @@ -192,7 +192,11 @@ API
.. c:function:: int uv_set_process_title(const char* title)
Sets the current process title.
Sets the current process title. On platforms with a fixed size buffer for the
process title the contents of `title` will be copied to the buffer and
truncated if larger than the available space. Other platforms will return
`UV_ENOMEM` if they cannot allocate enough space to duplicate the contents of
`title`.
.. c:function:: int uv_resident_set_memory(size_t* rss)
Expand Down
2 changes: 2 additions & 0 deletions deps/uv/include/pthread-barrier.h
Expand Up @@ -18,7 +18,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define _UV_PTHREAD_BARRIER_
#include <errno.h>
#include <pthread.h>
#if !defined(__MVS__)
#include <semaphore.h> /* sem_t */
#endif

#define PTHREAD_BARRIER_SERIAL_THREAD 0x12345

Expand Down
3 changes: 3 additions & 0 deletions deps/uv/include/uv-os390.h
Expand Up @@ -24,4 +24,7 @@

#define UV_PLATFORM_SEM_T int

#define UV_PLATFORM_LOOP_FIELDS \
void* ep; \

#endif /* UV_MVS_H */
4 changes: 4 additions & 0 deletions deps/uv/include/uv-unix.h
Expand Up @@ -36,14 +36,18 @@
#include <termios.h>
#include <pwd.h>

#if !defined(__MVS__)
#include <semaphore.h>
#endif
#include <pthread.h>
#include <signal.h>

#include "uv-threadpool.h"

#if defined(__linux__)
# include "uv-linux.h"
#elif defined (__MVS__)
# include "uv-os390.h"
#elif defined(_AIX)
# include "uv-aix.h"
#elif defined(__sun)
Expand Down
4 changes: 2 additions & 2 deletions deps/uv/include/uv-version.h
Expand Up @@ -31,8 +31,8 @@
*/

#define UV_VERSION_MAJOR 1
#define UV_VERSION_MINOR 10
#define UV_VERSION_PATCH 2
#define UV_VERSION_MINOR 11
#define UV_VERSION_PATCH 0
#define UV_VERSION_IS_RELEASE 1
#define UV_VERSION_SUFFIX ""

Expand Down
1 change: 1 addition & 0 deletions deps/uv/include/uv-win.h
Expand Up @@ -49,6 +49,7 @@ typedef struct pollfd {

#include <process.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/stat.h>

#if defined(_MSC_VER) && _MSC_VER < 1600
Expand Down
86 changes: 84 additions & 2 deletions deps/uv/src/unix/aix.c
Expand Up @@ -64,6 +64,11 @@
#define RDWR_BUF_SIZE 4096
#define EQ(a,b) (strcmp(a,b) == 0)

static void* args_mem = NULL;
static char** process_argv = NULL;
static int process_argc = 0;
static char* process_title_ptr = NULL;

int uv__platform_loop_init(uv_loop_t* loop) {
loop->fs_fd = -1;

Expand Down Expand Up @@ -753,6 +758,13 @@ static void uv__ahafs_event(uv_loop_t* loop, uv__io_t* event_watch, unsigned int

assert((bytes >= 0) && "uv__ahafs_event - Error reading monitor file");

/* In file / directory move cases, AIX Event infrastructure
* produces a second event with no data.
* Ignore it and return gracefully.
*/
if(bytes == 0)
return;

/* Parse the data */
if(bytes > 0)
rc = uv__parse_data(result_data, &events, handle);
Expand Down Expand Up @@ -881,24 +893,94 @@ void uv__fs_event_close(uv_fs_event_t* handle) {


char** uv_setup_args(int argc, char** argv) {
return argv;
char** new_argv;
size_t size;
char* s;
int i;

if (argc <= 0)
return argv;

/* Save the original pointer to argv.
* AIX uses argv to read the process name.
* (Not the memory pointed to by argv[0..n] as on Linux.)
*/
process_argv = argv;
process_argc = argc;

/* Calculate how much memory we need for the argv strings. */
size = 0;
for (i = 0; i < argc; i++)
size += strlen(argv[i]) + 1;

/* Add space for the argv pointers. */
size += (argc + 1) * sizeof(char*);

new_argv = uv__malloc(size);
if (new_argv == NULL)
return argv;
args_mem = new_argv;

/* Copy over the strings and set up the pointer table. */
s = (char*) &new_argv[argc + 1];
for (i = 0; i < argc; i++) {
size = strlen(argv[i]) + 1;
memcpy(s, argv[i], size);
new_argv[i] = s;
s += size;
}
new_argv[i] = NULL;

return new_argv;
}


int uv_set_process_title(const char* title) {
char* new_title;

/* We cannot free this pointer when libuv shuts down,
* the process may still be using it.
*/
new_title = uv__strdup(title);
if (new_title == NULL)
return -ENOMEM;

/* If this is the first time this is set,
* don't free and set argv[1] to NULL.
*/
if (process_title_ptr != NULL)
uv__free(process_title_ptr);

process_title_ptr = new_title;

process_argv[0] = process_title_ptr;
if (process_argc > 1)
process_argv[1] = NULL;

return 0;
}


int uv_get_process_title(char* buffer, size_t size) {
size_t len;
len = strlen(process_argv[0]);
if (buffer == NULL || size == 0)
return -EINVAL;
else if (size <= len)
return -ENOBUFS;

memcpy(buffer, process_argv[0], len + 1);

buffer[0] = '\0';
return 0;
}


UV_DESTRUCTOR(static void free_args_mem(void)) {
uv__free(args_mem); /* Keep valgrind happy. */
args_mem = NULL;
}


int uv_resident_set_memory(size_t* rss) {
char pp[64];
psinfo_t psinfo;
Expand Down
27 changes: 18 additions & 9 deletions deps/uv/src/unix/atomic-ops.h
Expand Up @@ -43,8 +43,12 @@ UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)) {
__compare_and_swap(ptr, &oldval, newval);
return out;
#elif defined(__MVS__)
return __plo_CS(ptr, (unsigned int*) ptr,
oldval, (unsigned int*) &newval);
unsigned int op4;
if (__plo_CSST(ptr, (unsigned int*) &oldval, newval,
(unsigned int*) ptr, *ptr, &op4))
return oldval;
else
return op4;
#else
return __sync_val_compare_and_swap(ptr, oldval, newval);
#endif
Expand All @@ -67,13 +71,18 @@ UV_UNUSED(static long cmpxchgl(long* ptr, long oldval, long newval)) {
# endif /* if defined(__64BIT__) */
return out;
#elif defined (__MVS__)
# ifdef _LP64
return __plo_CSGR(ptr, (unsigned long long*) ptr,
oldval, (unsigned long long*) &newval);
# else
return __plo_CS(ptr, (unsigned int*) ptr,
oldval, (unsigned int*) &newval);
# endif
#ifdef _LP64
unsigned long long op4;
if (__plo_CSSTGR(ptr, (unsigned long long*) &oldval, newval,
(unsigned long long*) ptr, *ptr, &op4))
#else
unsigned long op4;
if (__plo_CSST(ptr, (unsigned int*) &oldval, newval,
(unsigned int*) ptr, *ptr, &op4))
#endif
return oldval;
else
return op4;
#else
return __sync_val_compare_and_swap(ptr, oldval, newval);
#endif
Expand Down
3 changes: 3 additions & 0 deletions deps/uv/src/unix/core.c
Expand Up @@ -517,6 +517,9 @@ int uv__close_nocheckstdio(int fd) {

int uv__close(int fd) {
assert(fd > STDERR_FILENO); /* Catch stdio close bugs. */
#if defined(__MVS__)
epoll_file_close(fd);
#endif
return uv__close_nocheckstdio(fd);
}

Expand Down

0 comments on commit a12cdf0

Please sign in to comment.