Skip to content

Commit 2c91c65

Browse files
cjihrigtargos
authored andcommitted
deps: upgrade to libuv 1.31.0
Notable changes: - UV_FS_O_FILEMAP has been added for faster access to memory mapped files on Windows. - uv_fs_mkdir() now returns UV_EINVAL for invalid filenames on Windows. It previously returned UV_ENOENT. - The uv_fs_statfs() API has been added. - The uv_os_environ() and uv_os_free_environ() APIs have been added. Fixes: #28599 Fixes: #28945 Fixes: #29008 PR-URL: #29070 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Jiawen Geng <[email protected]>
1 parent 6f7b561 commit 2c91c65

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2136
-150
lines changed

deps/uv/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Makefile.in
5151
/test/run-benchmarks
5252
/test/run-benchmarks.exe
5353
/test/run-benchmarks.dSYM
54+
test_file_*
5455

5556
*.sln
5657
*.sln.cache

deps/uv/.mailmap

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Sam Roberts <[email protected]> <[email protected]>
3838
San-Tai Hsu <[email protected]>
3939
4040
Saúl Ibarra Corretgé <[email protected]>
41+
Saúl Ibarra Corretgé <[email protected]> <[email protected]>
4142
4243
Timothy J. Fontaine <[email protected]>
4344
Yasuhiro Matsumoto <[email protected]>

deps/uv/AUTHORS

+7
Original file line numberDiff line numberDiff line change
@@ -389,3 +389,10 @@ Jenil Christo <[email protected]>
389389
Evgeny Ermakov <[email protected]>
390390
gengjiawen <[email protected]>
391391
Leo Chung <[email protected]>
392+
Javier Blazquez <[email protected]>
393+
Mustafa M <[email protected]>
394+
Zach Bjornson <[email protected]>
395+
396+
Ben Davies <[email protected]>
397+
Nhan Khong <[email protected]>
398+

deps/uv/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ set(uv_test_sources
5353
test/test-fs-poll.c
5454
test/test-fs.c
5555
test/test-fs-readdir.c
56+
test/test-fs-fd-hash.c
57+
test/test-fs-open-flags.c
5658
test/test-get-currentexe.c
5759
test/test-get-loadavg.c
5860
test/test-get-memory.c

deps/uv/ChangeLog

+49
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,52 @@
1+
2019.08.10, Version 1.31.0 (Stable), 0a6771cee4c15184c924bfe9d397bdd0c3b206ba
2+
3+
Changes since version 1.30.1:
4+
5+
* win,fs: don't modify global file translation mode (Javier Blazquez)
6+
7+
* win: fix uv_os_tmpdir when env var is 260 chars (Mustafa M)
8+
9+
* win: prevent tty event explosion machine hang (Javier Blazquez)
10+
11+
* win: add UV_FS_O_FILEMAP (João Reis)
12+
13+
* win, fs: mkdir return UV_EINVAL for invalid names (Bartosz Sosnowski)
14+
15+
* github: add root warning to template (cjihrig)
16+
17+
* win: misc fs cleanup (cjihrig)
18+
19+
* unix,win: add uv_fs_statfs() (cjihrig)
20+
21+
* test: avoid AF_LOCAL (Carlo Marcelo Arenas Belón)
22+
23+
* unix,win: add ability to retrieve all env variables (Saúl Ibarra Corretgé)
24+
25+
* Revert "darwin: speed up uv_set_process_title()" (Ben Noordhuis)
26+
27+
* doc: add %p to valgrind log-file arg (Zach Bjornson)
28+
29+
* doc: fix typo in basics.rst (Nan Xiao)
30+
31+
* ibmi: support Makefile build for IBM i (Xu Meng)
32+
33+
* OpenBSD: only get active CPU core count (Ben Davies)
34+
35+
* test: fix gcc 8 warnings for tests (Nhan Khong)
36+
37+
* ibmi: use correct header files (Xu Meng)
38+
39+
* unix: clear UV_HANDLE_READING flag before callback (zyxwvu Shi)
40+
41+
* unix: fix unused-function warning on BSD (Nhan Khong)
42+
43+
* test: fix test runner on MinGW (Crunkle)
44+
45+
* win: remove try-except outside MSVC (Crunkle)
46+
47+
* win: fix uv_spawn() ENOMEM on empty env (Ben Noordhuis)
48+
49+
150
2019.07.03, Version 1.30.1 (Stable), 1551969c84c2f546a429dac169c7fdac3e38115e
251

352
Changes since version 1.30.0:

deps/uv/Makefile.am

+21
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ test_run_tests_SOURCES = test/blackhole-server.c \
184184
test/test-fs-poll.c \
185185
test/test-fs.c \
186186
test/test-fs-readdir.c \
187+
test/test-fs-fd-hash.c \
188+
test/test-fs-open-flags.c \
187189
test/test-fork.c \
188190
test/test-getters-setters.c \
189191
test/test-get-currentexe.c \
@@ -322,6 +324,12 @@ test_run_tests_CFLAGS += -D_ALL_SOURCE \
322324
-D_LINUX_SOURCE_COMPAT
323325
endif
324326

327+
if OS400
328+
test_run_tests_CFLAGS += -D_ALL_SOURCE \
329+
-D_XOPEN_SOURCE=500 \
330+
-D_LINUX_SOURCE_COMPAT
331+
endif
332+
325333
if HAIKU
326334
test_run_tests_CFLAGS += -D_BSD_SOURCE
327335
endif
@@ -362,6 +370,19 @@ uvinclude_HEADERS += include/uv/aix.h
362370
libuv_la_SOURCES += src/unix/aix.c src/unix/aix-common.c
363371
endif
364372

373+
if OS400
374+
libuv_la_CFLAGS += -D_ALL_SOURCE \
375+
-D_XOPEN_SOURCE=500 \
376+
-D_LINUX_SOURCE_COMPAT \
377+
-D_THREAD_SAFE
378+
uvinclude_HEADERS += include/uv/posix.h
379+
libuv_la_SOURCES += src/unix/aix-common.c \
380+
src/unix/ibmi.c \
381+
src/unix/posix-poll.c \
382+
src/unix/no-fsevents.c \
383+
src/unix/no-proctitle.c
384+
endif
385+
365386
if ANDROID
366387
uvinclude_HEADERS += include/uv/android-ifaddrs.h
367388
libuv_la_SOURCES += src/unix/android-ifaddrs.c \

deps/uv/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ $ gdb --args out/Debug/run-tests TEST_NAME
387387
Use the `--trace-children=yes` parameter:
388388

389389
```bash
390-
$ valgrind --trace-children=yes -v --tool=memcheck --leak-check=full --track-origins=yes --leak-resolution=high --show-reachable=yes --log-file=memcheck.log out/Debug/run-tests TEST_NAME
390+
$ valgrind --trace-children=yes -v --tool=memcheck --leak-check=full --track-origins=yes --leak-resolution=high --show-reachable=yes --log-file=memcheck-%p.log out/Debug/run-tests TEST_NAME
391391
```
392392

393393
### Running benchmarks

deps/uv/configure.ac

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1414

1515
AC_PREREQ(2.57)
16-
AC_INIT([libuv], [1.30.1], [https://github.com/libuv/libuv/issues])
16+
AC_INIT([libuv], [1.31.0], [https://github.com/libuv/libuv/issues])
1717
AC_CONFIG_MACRO_DIR([m4])
1818
m4_include([m4/libuv-extra-automake-flags.m4])
1919
m4_include([m4/as_case.m4])
@@ -63,6 +63,7 @@ AM_CONDITIONAL([MSYS], [AS_CASE([$host_os],[msys*], [true], [false])
6363
AM_CONDITIONAL([NETBSD], [AS_CASE([$host_os],[netbsd*], [true], [false])])
6464
AM_CONDITIONAL([OPENBSD], [AS_CASE([$host_os],[openbsd*], [true], [false])])
6565
AM_CONDITIONAL([OS390], [AS_CASE([$host_os],[openedition*], [true], [false])])
66+
AM_CONDITIONAL([OS400], [AS_CASE([$host_os],[os400], [true], [false])])
6667
AM_CONDITIONAL([SUNOS], [AS_CASE([$host_os],[solaris*], [true], [false])])
6768
AM_CONDITIONAL([WINNT], [AS_CASE([$host_os],[mingw*], [true], [false])])
6869
AS_CASE([$host_os],[mingw*], [

deps/uv/docs/src/fs.rst

+47
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,24 @@ Data types
102102
UV_FS_CLOSEDIR
103103
} uv_fs_type;
104104

105+
.. c:type:: uv_statfs_t
106+
107+
Reduced cross platform equivalent of ``struct statfs``.
108+
Used in :c:func:`uv_fs_statfs`.
109+
110+
::
111+
112+
typedef struct uv_statfs_s {
113+
uint64_t f_type;
114+
uint64_t f_bsize;
115+
uint64_t f_blocks;
116+
uint64_t f_bfree;
117+
uint64_t f_bavail;
118+
uint64_t f_files;
119+
uint64_t f_ffree;
120+
uint64_t f_spare[4];
121+
} uv_statfs_t;
122+
105123
.. c:type:: uv_dirent_t
106124
107125
Cross platform (reduced) equivalent of ``struct dirent``.
@@ -200,6 +218,11 @@ API
200218
201219
Equivalent to :man:`preadv(2)`.
202220
221+
.. warning::
222+
On Windows, under non-MSVC environments (e.g. when GCC or Clang is used
223+
to build libuv), files opened using ``UV_FS_O_FILEMAP`` may cause a fatal
224+
crash if the memory mapped read operation fails.
225+
203226
.. c:function:: int uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb)
204227
205228
Equivalent to :man:`unlink(2)`.
@@ -208,6 +231,11 @@ API
208231
209232
Equivalent to :man:`pwritev(2)`.
210233
234+
.. warning::
235+
On Windows, under non-MSVC environments (e.g. when GCC or Clang is used
236+
to build libuv), files opened using ``UV_FS_O_FILEMAP`` may cause a fatal
237+
crash if the memory mapped write operation fails.
238+
211239
.. c:function:: int uv_fs_mkdir(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode, uv_fs_cb cb)
212240
213241
Equivalent to :man:`mkdir(2)`.
@@ -290,6 +318,17 @@ API
290318
291319
Equivalent to :man:`stat(2)`, :man:`fstat(2)` and :man:`lstat(2)` respectively.
292320
321+
.. c:function:: int uv_fs_statfs(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb)
322+
323+
Equivalent to :man:`statfs(2)`. On success, a `uv_statfs_t` is allocated
324+
and returned via `req->ptr`. This memory is freed by `uv_fs_req_cleanup()`.
325+
326+
.. note::
327+
Any fields in the resulting `uv_statfs_t` that are not supported by the
328+
underlying operating system are set to zero.
329+
330+
.. versionadded:: 1.31.0
331+
293332
.. c:function:: int uv_fs_rename(uv_loop_t* loop, uv_fs_t* req, const char* path, const char* new_path, uv_fs_cb cb)
294333
295334
Equivalent to :man:`rename(2)`.
@@ -534,6 +573,14 @@ File open constants
534573
535574
.. versionchanged:: 1.17.0 support is added for Windows.
536575
576+
.. c:macro:: UV_FS_O_FILEMAP
577+
578+
Use a memory file mapping to access the file. When using this flag, the
579+
file cannot be open multiple times concurrently.
580+
581+
.. note::
582+
`UV_FS_O_FILEMAP` is only supported on Windows.
583+
537584
.. c:macro:: UV_FS_O_NOATIME
538585
539586
Do not update the file access time when the file is read.

deps/uv/docs/src/misc.rst

+28
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,17 @@ Data types
180180
char machine[256];
181181
} uv_utsname_t;
182182

183+
.. c:type:: uv_env_item_t
184+
185+
Data type for environment variable storage.
186+
187+
::
188+
189+
typedef struct uv_env_item_s {
190+
char* name;
191+
char* value;
192+
} uv_env_item_t;
193+
183194

184195
API
185196
---
@@ -523,6 +534,23 @@ API
523534
524535
.. versionadded:: 1.8.0
525536
537+
.. c:function:: int uv_os_environ(uv_env_item_t** envitems, int* count)
538+
539+
Retrieves all environment variables. This function will allocate memory
540+
which must be freed by calling :c:func:`uv_os_free_environ`.
541+
542+
.. warning::
543+
This function is not thread safe.
544+
545+
.. versionadded:: 1.31.0
546+
547+
.. c:function:: void uv_os_free_environ(uv_env_item_t* envitems, int count);
548+
549+
Frees the memory allocated for the environment variables by
550+
:c:func:`uv_os_environ`.
551+
552+
.. versionadded:: 1.31.0
553+
526554
.. c:function:: int uv_os_getenv(const char* name, char* buffer, size_t* size)
527555
528556
Retrieves the environment variable specified by `name`, copies its value

deps/uv/include/uv.h

+26-1
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,13 @@ typedef struct uv_fs_s uv_fs_t;
231231
typedef struct uv_work_s uv_work_t;
232232

233233
/* None of the above. */
234+
typedef struct uv_env_item_s uv_env_item_t;
234235
typedef struct uv_cpu_info_s uv_cpu_info_t;
235236
typedef struct uv_interface_address_s uv_interface_address_t;
236237
typedef struct uv_dirent_s uv_dirent_t;
237238
typedef struct uv_passwd_s uv_passwd_t;
238239
typedef struct uv_utsname_s uv_utsname_t;
240+
typedef struct uv_statfs_s uv_statfs_t;
239241

240242
typedef enum {
241243
UV_LOOP_BLOCK_SIGNAL
@@ -1070,6 +1072,17 @@ struct uv_utsname_s {
10701072
to as meaningless in the docs. */
10711073
};
10721074

1075+
struct uv_statfs_s {
1076+
uint64_t f_type;
1077+
uint64_t f_bsize;
1078+
uint64_t f_blocks;
1079+
uint64_t f_bfree;
1080+
uint64_t f_bavail;
1081+
uint64_t f_files;
1082+
uint64_t f_ffree;
1083+
uint64_t f_spare[4];
1084+
};
1085+
10731086
typedef enum {
10741087
UV_DIRENT_UNKNOWN,
10751088
UV_DIRENT_FILE,
@@ -1150,6 +1163,13 @@ UV_EXTERN int uv_interface_addresses(uv_interface_address_t** addresses,
11501163
UV_EXTERN void uv_free_interface_addresses(uv_interface_address_t* addresses,
11511164
int count);
11521165

1166+
struct uv_env_item_s {
1167+
char* name;
1168+
char* value;
1169+
};
1170+
1171+
UV_EXTERN int uv_os_environ(uv_env_item_t** envitems, int* count);
1172+
UV_EXTERN void uv_os_free_environ(uv_env_item_t* envitems, int count);
11531173
UV_EXTERN int uv_os_getenv(const char* name, char* buffer, size_t* size);
11541174
UV_EXTERN int uv_os_setenv(const char* name, const char* value);
11551175
UV_EXTERN int uv_os_unsetenv(const char* name);
@@ -1205,7 +1225,8 @@ typedef enum {
12051225
UV_FS_LCHOWN,
12061226
UV_FS_OPENDIR,
12071227
UV_FS_READDIR,
1208-
UV_FS_CLOSEDIR
1228+
UV_FS_CLOSEDIR,
1229+
UV_FS_STATFS
12091230
} uv_fs_type;
12101231

12111232
struct uv_dir_s {
@@ -1433,6 +1454,10 @@ UV_EXTERN int uv_fs_lchown(uv_loop_t* loop,
14331454
uv_uid_t uid,
14341455
uv_gid_t gid,
14351456
uv_fs_cb cb);
1457+
UV_EXTERN int uv_fs_statfs(uv_loop_t* loop,
1458+
uv_fs_t* req,
1459+
const char* path,
1460+
uv_fs_cb cb);
14361461

14371462

14381463
enum uv_fs_event {

deps/uv/include/uv/unix.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
# include "uv/linux.h"
5050
#elif defined (__MVS__)
5151
# include "uv/os390.h"
52+
#elif defined(__PASE__) /* __PASE__ and _AIX are both defined on IBM i */
53+
# include "uv/posix.h" /* IBM i needs uv/posix.h, not uv/aix.h */
5254
#elif defined(_AIX)
5355
# include "uv/aix.h"
5456
#elif defined(__sun)
@@ -61,8 +63,7 @@
6163
defined(__OpenBSD__) || \
6264
defined(__NetBSD__)
6365
# include "uv/bsd.h"
64-
#elif defined(__PASE__) || \
65-
defined(__CYGWIN__) || \
66+
#elif defined(__CYGWIN__) || \
6667
defined(__MSYS__) || \
6768
defined(__GNU__)
6869
# include "uv/posix.h"
@@ -481,6 +482,7 @@ typedef struct {
481482
#endif
482483

483484
/* fs open() flags supported on other platforms: */
485+
#define UV_FS_O_FILEMAP 0
484486
#define UV_FS_O_RANDOM 0
485487
#define UV_FS_O_SHORT_LIVED 0
486488
#define UV_FS_O_SEQUENTIAL 0

deps/uv/include/uv/version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
*/
3232

3333
#define UV_VERSION_MAJOR 1
34-
#define UV_VERSION_MINOR 30
35-
#define UV_VERSION_PATCH 1
34+
#define UV_VERSION_MINOR 31
35+
#define UV_VERSION_PATCH 0
3636
#define UV_VERSION_IS_RELEASE 1
3737
#define UV_VERSION_SUFFIX ""
3838

deps/uv/include/uv/win.h

+1
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ typedef struct {
668668
#define UV_FS_O_APPEND _O_APPEND
669669
#define UV_FS_O_CREAT _O_CREAT
670670
#define UV_FS_O_EXCL _O_EXCL
671+
#define UV_FS_O_FILEMAP 0x20000000
671672
#define UV_FS_O_RANDOM _O_RANDOM
672673
#define UV_FS_O_RDONLY _O_RDONLY
673674
#define UV_FS_O_RDWR _O_RDWR

0 commit comments

Comments
 (0)