Skip to content

Commit

Permalink
Merge branch 'v1.x' of https://github.com/libuv/libuv into v1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaozg committed Feb 20, 2021
2 parents 75679e0 + 285a5ea commit 98be7c0
Show file tree
Hide file tree
Showing 101 changed files with 707 additions and 404 deletions.
1 change: 1 addition & 0 deletions .mailmap
Expand Up @@ -48,6 +48,7 @@ Timothy J. Fontaine <tjfontaine@gmail.com>
Yasuhiro Matsumoto <mattn.jp@gmail.com>
Yazhong Liu <yorkiefixer@gmail.com>
Yuki Okumura <mjt@cltn.org>
cjihrig <cjihrig@gmail.com>
gengjiawen <technicalcute@gmail.com>
jBarz <jBarz@users.noreply.github.com> <jbarboza@ca.ibm.com>
jBarz <jBarz@users.noreply.github.com> <jbarz@users.noreply.github.com>
Expand Down
11 changes: 11 additions & 0 deletions AUTHORS
Expand Up @@ -448,3 +448,14 @@ Aleksej Lebedev <root@zta.lk>
Nikolay Mitev <github@hmel.org>
Ulrik Strid <ulrik.strid@outlook.com>
Elad Lahav <elahav@qnx.com>
Elad Nachmias <eladn@pazam.net>
Darshan Sen <raisinten@gmail.com>
Simon Kadisch <simon.kadisch@k13-engineering.at>
Momtchil Momtchev <momtchil@momtchev.com>
Ethel Weston <66453757+ethelweston@users.noreply.github.com>
Drew DeVault <sir@cmpwn.com>
Mark Klein <klein@cscs.ch>
schamberg97 <50446906+schamberg97@users.noreply.github.com>
Bob Weinand <bobwei9@hotmail.com>
Issam E. Maghni <issam.e.maghni@mailbox.org>
Juan Pablo Canepa <jpcanepa@gmail.com>
44 changes: 38 additions & 6 deletions CMakeLists.txt
Expand Up @@ -212,7 +212,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android")
src/unix/random-sysctl-linux.c)
endif()

if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "Android|Linux|OS390")
if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "Android|Linux")
list(APPEND uv_sources src/unix/proctitle.c)
endif()

Expand Down Expand Up @@ -266,9 +266,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
list(APPEND uv_defines PATH_MAX=255)
enable_language(CXX)
list(APPEND uv_defines PATH_MAX=1024)
list(APPEND uv_defines _AE_BIMODAL)
list(APPEND uv_defines _ALL_SOURCE)
list(APPEND uv_defines _ENHANCED_ASCII_EXT=0xFFFFFFFF)
list(APPEND uv_defines _ISOC99_SOURCE)
list(APPEND uv_defines _LARGE_TIME_API)
list(APPEND uv_defines _OPEN_MSGQ_EXT)
Expand All @@ -279,14 +281,31 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
list(APPEND uv_defines _UNIX03_SOURCE)
list(APPEND uv_defines _UNIX03_THREADS)
list(APPEND uv_defines _UNIX03_WITHDRAWN)
list(APPEND uv_defines _XOPEN_SOURCE=600)
list(APPEND uv_defines _XOPEN_SOURCE_EXTENDED)
list(APPEND uv_sources
src/unix/pthread-fixes.c
src/unix/os390.c
src/unix/os390-syscalls.c)
list(APPEND uv_cflags -Wc,DLL -Wc,exportall -Wc,xplink)
list(APPEND uv_libraries -Wl,xplink)
list(APPEND uv_test_libraries -Wl,xplink)
src/unix/os390-syscalls.c
src/unix/os390-proctitle.c)
list(APPEND uv_cflags
-q64
-qascii
-qexportall
-qgonumber
-qlongname
-qlibansi
-qfloat=IEEE
-qtune=10
-qarch=10
-qasm
-qasmlib=sys1.maclib:sys1.modgen)
find_library(ZOSLIB
NAMES zoslib
PATHS ${ZOSLIB_DIR}
PATH_SUFFIXES lib
)
list(APPEND uv_libraries ${ZOSLIB})
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "OS400")
Expand Down Expand Up @@ -349,6 +368,10 @@ target_include_directories(uv
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
target_include_directories(uv PUBLIC $<BUILD_INTERFACE:${ZOSLIB_DIR}/include>)
set_target_properties(uv PROPERTIES LINKER_LANGUAGE CXX)
endif()
target_link_libraries(uv ${uv_libraries})

add_library(uv_a STATIC ${uv_sources})
Expand All @@ -360,6 +383,10 @@ target_include_directories(uv_a
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
target_include_directories(uv_a PUBLIC $<BUILD_INTERFACE:${ZOSLIB_DIR}/include>)
set_target_properties(uv_a PROPERTIES LINKER_LANGUAGE CXX)
endif()
target_link_libraries(uv_a ${uv_libraries})

if(LIBUV_BUILD_TESTS)
Expand Down Expand Up @@ -582,6 +609,11 @@ if(LIBUV_BUILD_TESTS)
add_test(NAME uv_test_a
COMMAND uv_run_tests_a
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
set_target_properties(uv_run_benchmarks_a PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(uv_run_tests PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(uv_run_tests_a PROPERTIES LINKER_LANGUAGE CXX)
endif()
endif()

if(UNIX OR MINGW)
Expand Down
79 changes: 79 additions & 0 deletions ChangeLog
@@ -1,3 +1,82 @@
2021.02.14, Version 1.41.0 (Stable), 1dff88e5161cba5c59276d2070d2e304e4dcb242

Changes since version 1.40.0:

* mailmap: update contact information for richardlau (Richard Lau)

* build: add asan checks (gengjiawen)

* unix: report bind error in uv_tcp_connect() (Ben Noordhuis)

* doc: uv_tcp_bind() never returns UV_EADDRINUSE (Ben Noordhuis)

* test: fix pump and tcp_write_batch benchmarks (Santiago Gimeno)

* doc: mark IBM i as Tier 2 support (Jesse Gorzinski)

* doc,poll: add notes (repeated cb & cancel pending cb) (Elad Nachmias)

* linux: fix -Wincompatible-pointer-types warning (Ben Noordhuis)

* linux: fix -Wsign-compare warning (Ben Noordhuis)

* android: add system call api guards (Ben Noordhuis)

* unix,win: harmonize uv_read_start() error handling (Ben Noordhuis)

* unix,win: more uv_read_start() argument validation (Ben Noordhuis)

* build: turn on -fno-strict-aliasing (Ben Noordhuis)

* stream: add uv_pipe and uv_socketpair to the API (Jameson Nash)

* unix,win: initialize timer `timeout` field (Ben Noordhuis)

* bsd-ifaddrs: improve comments (Darshan Sen)

* test: remove unnecessary uv_fs_stat() calls (Ben Noordhuis)

* fs: fix utime/futime timestamp rounding errors (Ben Noordhuis)

* test: ensure reliable floating point comparison (Jameson Nash)

* unix,fs: fix uv_fs_sendfile() (Santiago Gimeno)

* unix: fix uv_fs_stat when using statx (Simon Kadisch)

* linux,macos: fix uv_set_process_title regression (Momtchil Momtchev)

* doc: clarify UDP errors and recvmmsg (Ethel Weston)

* test-getaddrinfo: use example.invalid (Drew DeVault)

* Revert "build: fix android autotools build" (Bernardo Ramos)

* unix,fs: on DVS fs, statx returns EOPNOTSUPP (Mark Klein)

* win, fs: mkdir really return UV_EINVAL for invalid names (Nicholas Vavilov)

* tools: migrate tools/make_dist_html.py to python3 (Dominique Dumont)

* unix: fix uv_uptime() on linux (schamberg97)

* unix: check for partial copy_file_range support (Momtchil Momtchev)

* win: bump minimum supported version to windows 8 (Ben Noordhuis)

* poll,unix: ensure safety of rapid fd reuse (Bob Weinand)

* test: fix some warnings (Issam E. Maghni)

* unix: fix uv_uptime() regression (Santiago Gimeno)

* doc: fix versionadded metadata (cjihrig)

* test: fix 'incompatible pointer types' warnings (cjihrig)

* unix: check for EXDEV in uv__fs_sendfile() (Darshan Sen)


2020.09.26, Version 1.40.0 (Stable), 4e69e333252693bd82d6338d6124f0416538dbfc

Changes since version 1.39.0:
Expand Down
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -308,6 +308,13 @@ describes the package in more detail.

### z/OS Notes

z/OS compilation requires [ZOSLIB](https://github.com/ibmruntimes/zoslib) to be installed. When building with [CMake][], use the flag `-DZOSLIB_DIR` to specify the path to [ZOSLIB](https://github.com/ibmruntimes/zoslib):

```bash
$ (cd build && cmake .. -DBUILD_TESTING=ON -DZOSLIB_DIR=/path/to/zoslib)
$ cmake --build build
```

z/OS creates System V semaphores and message queues. These persist on the system
after the process terminates unless the event loop is closed.

Expand Down
2 changes: 1 addition & 1 deletion 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.40.0], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.41.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
2 changes: 2 additions & 0 deletions docs/src/guide/basics.rst
Expand Up @@ -87,6 +87,7 @@ nothing, except start a loop which will exit immediately.

.. rubric:: helloworld/main.c
.. literalinclude:: ../../code/helloworld/main.c
:language: c
:linenos:

This program quits immediately because it has no events to process. A libuv
Expand Down Expand Up @@ -202,6 +203,7 @@ event watchers are active.

.. rubric:: idle-basic/main.c
.. literalinclude:: ../../code/idle-basic/main.c
:language: c
:emphasize-lines: 6,10,14-17

Storing context
Expand Down
2 changes: 2 additions & 0 deletions docs/src/guide/eventloops.rst
Expand Up @@ -20,6 +20,7 @@ these things can be a bit difficult to understand, so let's look at

.. rubric:: src/unix/core.c - uv_run
.. literalinclude:: ../../../src/unix/core.c
:language: c
:linenos:
:lines: 304-324
:emphasize-lines: 10,19,21
Expand All @@ -43,6 +44,7 @@ iteration of the loop still takes places.

.. rubric:: uvstop/main.c
.. literalinclude:: ../../code/uvstop/main.c
:language: c
:linenos:
:emphasize-lines: 11

9 changes: 9 additions & 0 deletions docs/src/guide/filesystem.rst
Expand Up @@ -54,6 +54,7 @@ a callback for when the file is opened:

.. rubric:: uvcat/main.c - opening a file
.. literalinclude:: ../../code/uvcat/main.c
:language: c
:linenos:
:lines: 41-53
:emphasize-lines: 4, 6-7
Expand All @@ -63,6 +64,7 @@ The ``result`` field of a ``uv_fs_t`` is the file descriptor in case of the

.. rubric:: uvcat/main.c - read callback
.. literalinclude:: ../../code/uvcat/main.c
:language: c
:linenos:
:lines: 26-40
:emphasize-lines: 2,8,12
Expand All @@ -87,6 +89,7 @@ callbacks.

.. rubric:: uvcat/main.c - write callback
.. literalinclude:: ../../code/uvcat/main.c
:language: c
:linenos:
:lines: 16-24
:emphasize-lines: 6
Expand All @@ -100,6 +103,7 @@ We set the dominos rolling in ``main()``:

.. rubric:: uvcat/main.c
.. literalinclude:: ../../code/uvcat/main.c
:language: c
:linenos:
:lines: 55-
:emphasize-lines: 2
Expand Down Expand Up @@ -203,6 +207,7 @@ opened as bidirectional by default.

.. rubric:: uvtee/main.c - read on pipes
.. literalinclude:: ../../code/uvtee/main.c
:language: c
:linenos:
:lines: 61-80
:emphasize-lines: 4,5,15
Expand All @@ -218,6 +223,7 @@ these buffers.

.. rubric:: uvtee/main.c - reading buffers
.. literalinclude:: ../../code/uvtee/main.c
:language: c
:linenos:
:lines: 19-22,44-60

Expand All @@ -242,6 +248,7 @@ point there is nothing to be read. Most applications will just ignore this.

.. rubric:: uvtee/main.c - Write to pipe
.. literalinclude:: ../../code/uvtee/main.c
:language: c
:linenos:
:lines: 9-13,23-42

Expand Down Expand Up @@ -282,6 +289,7 @@ The file change notification is started using ``uv_fs_event_init()``:

.. rubric:: onchange/main.c - The setup
.. literalinclude:: ../../code/onchange/main.c
:language: c
:linenos:
:lines: 26-
:emphasize-lines: 15
Expand Down Expand Up @@ -320,6 +328,7 @@ In our example we simply print the arguments and run the command using

.. rubric:: onchange/main.c - file change notification callback
.. literalinclude:: ../../code/onchange/main.c
:language: c
:linenos:
:lines: 9-24

Expand Down
7 changes: 7 additions & 0 deletions docs/src/guide/networking.rst
Expand Up @@ -38,6 +38,7 @@ Here is a simple echo server

.. rubric:: tcp-echo-server/main.c - The listen socket
.. literalinclude:: ../../code/tcp-echo-server/main.c
:language: c
:linenos:
:lines: 68-
:emphasize-lines: 4-5,7-10
Expand All @@ -60,6 +61,7 @@ In this case we also establish interest in reading from this stream.

.. rubric:: tcp-echo-server/main.c - Accepting the client
.. literalinclude:: ../../code/tcp-echo-server/main.c
:language: c
:linenos:
:lines: 51-66
:emphasize-lines: 9-10
Expand Down Expand Up @@ -108,6 +110,7 @@ address from a `DHCP`_ server -- DHCP Discover.

.. rubric:: udp-dhcp/main.c - Setup and send UDP packets
.. literalinclude:: ../../code/udp-dhcp/main.c
:language: c
:linenos:
:lines: 7-11,104-
:emphasize-lines: 8,10-11,17-18,21
Expand Down Expand Up @@ -143,6 +146,7 @@ the OS will discard the data that could not fit* (That's UDP for you!).

.. rubric:: udp-dhcp/main.c - Reading packets
.. literalinclude:: ../../code/udp-dhcp/main.c
:language: c
:linenos:
:lines: 17-40
:emphasize-lines: 1,23
Expand Down Expand Up @@ -193,6 +197,7 @@ Freenode to see an example of DNS resolution.

.. rubric:: dns/main.c
.. literalinclude:: ../../code/dns/main.c
:language: c
:linenos:
:lines: 61-
:emphasize-lines: 12
Expand All @@ -209,6 +214,7 @@ call ``uv_freeaddrinfo`` in the callback.

.. rubric:: dns/main.c
.. literalinclude:: ../../code/dns/main.c
:language: c
:linenos:
:lines: 42-60
:emphasize-lines: 8,16
Expand All @@ -227,6 +233,7 @@ useful to allow your service to bind to IP addresses when it starts.

.. rubric:: interfaces/main.c
.. literalinclude:: ../../code/interfaces/main.c
:language: c
:linenos:
:emphasize-lines: 9,17

Expand Down

0 comments on commit 98be7c0

Please sign in to comment.