Skip to content

Commit 055ebfd

Browse files
committed
WIP
1 parent 0c64552 commit 055ebfd

Some content is hidden

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

91 files changed

+2167
-577
lines changed

deps/uv/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,5 +165,5 @@ not send out notifications when you add commits.
165165
[issue tracker]: https://github.com/libuv/libuv/issues
166166
[libuv mailing list]: http://groups.google.com/group/libuv
167167
[IRC]: http://webchat.freelibuv.net/?channels=libuv
168-
[Google C/C++ style guide]: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
168+
[Google C/C++ style guide]: https://google.github.io/styleguide/cppguide.html
169169
[project maintainers]: https://github.com/libuv/libuv/blob/master/MAINTAINERS.md

deps/uv/LICENSE

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
1-
libuv is part of the Node project: http://nodejs.org/
2-
libuv may be distributed alone under Node's license:
1+
libuv is licensed for use as follows:
2+
3+
====
4+
Copyright (c) 2015-present libuv project contributors.
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to
8+
deal in the Software without restriction, including without limitation the
9+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10+
sell copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22+
IN THE SOFTWARE.
23+
====
24+
25+
This license applies to parts of libuv originating from the
26+
https://github.com/joyent/libuv repository:
327

428
====
529

deps/uv/MAINTAINERS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@ libuv is currently managed by the following individuals:
77
- GPG key: D77B 1E34 243F BAF0 5F8E 9CC3 4F55 C8C8 46AB 89B9 (pubkey-bnoordhuis)
88
* **Bert Belder** ([@piscisaureus](https://github.com/piscisaureus))
99
* **Colin Ihrig** ([@cjihrig](https://github.com/cjihrig))
10+
- GPG key: 94AE 3667 5C46 4D64 BAFA 68DD 7434 390B DBE9 B9C5 (pubkey-cjihrig)
1011
* **Fedor Indutny** ([@indutny](https://github.com/indutny))
1112
- GPG key: AF2E EA41 EC34 47BF DD86 FED9 D706 3CCE 19B7 E890 (pubkey-indutny)
13+
* **Imran Iqbal** ([@iWuzHere](https://github.com/iWuzHere))
14+
- GPG key: 9DFE AA5F 481B BF77 2D90 03CE D592 4925 2F8E C41A (pubkey-iwuzhere)
15+
* **Santiago Gimeno** ([@santigimeno](https://github.com/santigimeno))
16+
- GPG key: 612F 0EAD 9401 6223 79DF 4402 F28C 3C8D A33C 03BE (pubkey-santigimeno)
1217
* **Saúl Ibarra Corretgé** ([@saghul](https://github.com/saghul))
1318
- GPG key: FDF5 1936 4458 319F A823 3DC9 410E 5553 AE9B C059 (pubkey-saghul)
1419

@@ -34,4 +39,3 @@ be garbage collected since nothing references it, so we'll create a tag for it:
3439
Commit the changes and push:
3540

3641
$ git push origin pubkey-saghul
37-

deps/uv/Makefile.am

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ libuv_la_SOURCES = src/fs-poll.c \
3636
if SUNOS
3737
# Can't be turned into a CC_CHECK_CFLAGS in configure.ac, it makes compilers
3838
# on other platforms complain that the argument is unused during compilation.
39-
libuv_la_CFLAGS += -pthread
39+
libuv_la_CFLAGS += -pthreads
4040
endif
4141

4242
if WINNT
@@ -48,6 +48,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/src/win \
4848
libuv_la_SOURCES += src/win/async.c \
4949
src/win/atomicops-inl.h \
5050
src/win/core.c \
51+
src/win/detect-wakeup.c \
5152
src/win/dl.c \
5253
src/win/error.c \
5354
src/win/fs-event.c \
@@ -128,7 +129,18 @@ EXTRA_DIST = test/fixtures/empty_file \
128129

129130
TESTS = test/run-tests
130131
check_PROGRAMS = test/run-tests
132+
if OS390
131133
test_run_tests_CFLAGS =
134+
else
135+
test_run_tests_CFLAGS = -Wno-long-long
136+
endif
137+
138+
if SUNOS
139+
# Can't be turned into a CC_CHECK_CFLAGS in configure.ac, it makes compilers
140+
# on other platforms complain that the argument is unused during compilation.
141+
test_run_tests_CFLAGS += -pthreads
142+
endif
143+
132144
test_run_tests_LDFLAGS =
133145
test_run_tests_SOURCES = test/blackhole-server.c \
134146
test/dns-server.c \
@@ -215,6 +227,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
215227
test/test-socket-buffer-size.c \
216228
test/test-spawn.c \
217229
test/test-stdio-over-pipes.c \
230+
test/test-tcp-alloc-cb-fail.c \
218231
test/test-tcp-bind-error.c \
219232
test/test-tcp-bind6-error.c \
220233
test/test-tcp-close-accept.c \
@@ -246,6 +259,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
246259
test/test-timer.c \
247260
test/test-tmpdir.c \
248261
test/test-tty.c \
262+
test/test-udp-alloc-cb-fail.c \
249263
test/test-udp-bind.c \
250264
test/test-udp-create-socket-early.c \
251265
test/test-udp-dgram-too-big.c \
@@ -277,10 +291,29 @@ if AIX
277291
test_run_tests_CFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500 -D_LINUX_SOURCE_COMPAT
278292
endif
279293

294+
if LINUX
295+
test_run_tests_CFLAGS += -D_GNU_SOURCE
296+
endif
297+
280298
if SUNOS
281299
test_run_tests_CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
282300
endif
283301

302+
if OS390
303+
test_run_tests_CFLAGS += -D_UNIX03_THREADS \
304+
-D_UNIX03_SOURCE \
305+
-D_OPEN_SYS_IF_EXT=1 \
306+
-D_OPEN_SYS_SOCK_IPV6 \
307+
-D_OPEN_MSGQ_EXT \
308+
-D_XOPEN_SOURCE_EXTENDED \
309+
-D_ALL_SOURCE \
310+
-D_LARGE_TIME_API \
311+
-D_OPEN_SYS_FILE_EXT \
312+
-DPATH_MAX=255 \
313+
-qCHARS=signed \
314+
-qXPLINK \
315+
-qFLOAT=IEEE
316+
endif
284317

285318
if AIX
286319
libuv_la_CFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500 -D_LINUX_SOURCE_COMPAT -D_THREAD_SAFE
@@ -312,6 +345,7 @@ endif
312345

313346
if DRAGONFLY
314347
include_HEADERS += include/uv-bsd.h
348+
libuv_la_SOURCES += src/unix/freebsd.c src/unix/kqueue.c
315349
test_run_tests_LDFLAGS += -lutil
316350
endif
317351

@@ -350,6 +384,28 @@ libuv_la_CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
350384
libuv_la_SOURCES += src/unix/sunos.c
351385
endif
352386

387+
if OS390
388+
include_HEADERS += include/pthread-fixes.h include/pthread-barrier.h
389+
libuv_la_CFLAGS += -D_UNIX03_THREADS \
390+
-D_UNIX03_SOURCE \
391+
-D_OPEN_SYS_IF_EXT=1 \
392+
-D_OPEN_MSGQ_EXT \
393+
-D_XOPEN_SOURCE_EXTENDED \
394+
-D_ALL_SOURCE \
395+
-D_LARGE_TIME_API \
396+
-D_OPEN_SYS_SOCK_IPV6 \
397+
-D_OPEN_SYS_FILE_EXT \
398+
-DUV_PLATFORM_SEM_T=int \
399+
-DPATH_MAX=255 \
400+
-qCHARS=signed \
401+
-qXPLINK \
402+
-qFLOAT=IEEE
403+
libuv_la_LDFLAGS += -qXPLINK
404+
libuv_la_SOURCES += src/unix/pthread-fixes.c \
405+
src/unix/pthread-barrier.c
406+
libuv_la_SOURCES += src/unix/os390.c
407+
endif
408+
353409
if HAVE_PKG_CONFIG
354410
pkgconfigdir = $(libdir)/pkgconfig
355411
pkgconfig_DATA = @[email protected]

deps/uv/Makefile.mingw

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ OBJS = src/fs-poll.o \
4848
src/version.o \
4949
src/win/async.o \
5050
src/win/core.o \
51+
src/win/detect-wakeup.o \
5152
src/win/dl.o \
5253
src/win/error.o \
5354
src/win/fs-event.o \

deps/uv/README.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ Starting with version 1.0.0 libuv follows the [semantic versioning](http://semve
3939
scheme. The API change and backwards compatibility rules are those indicated by
4040
SemVer. libuv will keep a stable ABI across major releases.
4141

42+
The ABI/API changes can be tracked [here](http://abi-laboratory.pro/tracker/timeline/libuv/).
43+
44+
## Licensing
45+
46+
libuv is licensed under the MIT license. Check the [LICENSE file](LICENSE).
47+
4248
## Community
4349

4450
* [Mailing list](http://groups.google.com/group/libuv)
@@ -220,18 +226,7 @@ Run:
220226

221227
## Supported Platforms
222228

223-
Microsoft Windows operating systems since Windows XP SP2. It can be built
224-
with either Visual Studio or MinGW. Consider using
225-
[Visual Studio Express 2010][] or later if you do not have a full Visual
226-
Studio license.
227-
228-
Linux using the GCC toolchain.
229-
230-
OS X using the GCC or XCode toolchain.
231-
232-
Solaris 121 and later using GCC toolchain.
233-
234-
AIX 6 and later using GCC toolchain (see notes).
229+
Check the [SUPPORTED_PLATFORMS file](SUPPORTED_PLATFORMS.md).
235230

236231
### AIX Notes
237232

@@ -250,7 +245,6 @@ See the [guidelines for contributing][].
250245
[node.js]: http://nodejs.org/
251246
[GYP]: http://code.google.com/p/gyp/
252247
[Python]: https://www.python.org/downloads/
253-
[Visual Studio Express 2010]: http://www.microsoft.com/visualstudio/eng/products/visual-studio-2010-express
254248
[guidelines for contributing]: https://github.com/libuv/libuv/blob/master/CONTRIBUTING.md
255249
[libuv_banner]: https://raw.githubusercontent.com/libuv/libuv/master/img/banner.png
256250
[x32]: https://en.wikipedia.org/wiki/X32_ABI

deps/uv/SUPPORTED_PLATFORMS.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Supported platforms
2+
3+
| System | Support type | Supported versions | Notes |
4+
|---|---|---|---|
5+
| GNU/Linux | Tier 1 | Linux >= 2.6.18 with glibc >= 2.5 | |
6+
| macOS | Tier 1 | macOS >= 10.7 | |
7+
| Windows | Tier 1 | Windows >= XP SP1 | MSVC 2008 and later are supported |
8+
| FreeBSD | Tier 1 | >= 9 (see note) | |
9+
| AIX | Tier 2 | >= 6 | Maintainers: @libuv/aix |
10+
| z/OS | Tier 2 | >= V2R2 | Maintainers: @libuv/zos |
11+
| Linux with musl | Tier 2 | musl >= 1.0 | |
12+
| SunOS | Tier 2 | Solaris 121 and later | Maintainers: @libuv/sunos |
13+
| MinGW | Tier 3 | MinGW32 and MinGW-w64 | |
14+
| Other | Tier 3 | N/A | |
15+
16+
#### Note on FreeBSD 9
17+
18+
While FreeBSD is supported as Tier 1, FreeBSD 9 will get Tier 2 support until
19+
it reaches end of life, in December 2016.
20+
21+
## Support types
22+
23+
* **Tier 1**: Officially supported and tested with CI. Any contributed patch
24+
MUST NOT break such systems. These are supported by @libuv/collaborators.
25+
26+
* **Tier 2**: Officially supported, but not necessarily tested with CI. These
27+
systems are maintained to the best of @libuv/collaborators ability,
28+
without being a top priority.
29+
30+
* **Tier 3**: Community maintained. These systems may inadvertently break and the
31+
community and interested parties are expected to help with the maintenance.
32+
33+
## Adding support for a new platform
34+
35+
**IMPORTANT**: Before attempting to add support for a new platform please open
36+
an issue about it for discussion.
37+
38+
### Unix
39+
40+
I/O handling is abstracted by an internal `uv__io_t` handle. The new platform
41+
will need to implement some of the functions, the prototypes are in
42+
``src/unix/internal.h``.
43+
44+
If the new platform requires extra fields for any handle structure, create a
45+
new include file in ``include/`` with the name ``uv-theplatform.h`` and add
46+
the appropriate defines there.
47+
48+
All functionality related to the new platform must be implemented in its own
49+
file inside ``src/unix/`` unless it's already done in a common file, in which
50+
case adding an `ifdef` is fine.
51+
52+
Two build systems are supported: autotools and GYP. Ideally both need to be
53+
supported, but if GYP does not support the new platform it can be left out.
54+
55+
### Windows
56+
57+
Windows is treated as a single platform, so adding support for a new platform
58+
would mean adding support for a new version.
59+
60+
Compilation and runtime must succeed for the minimum supported version. If a
61+
new API is to be used, it must be done optionally, only in supported versions.
62+
63+
### Common
64+
65+
Some common notes when adding support for new platforms:
66+
67+
* Generally libuv tries to avoid compile time checks. Do not add any to the
68+
autotools based build system or use version checking macros.
69+
Dynamically load functions and symbols if they are not supported by the
70+
minimum supported version.

deps/uv/common.gypi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
'configurations': {
1212
'Debug': {
1313
'defines': [ 'DEBUG', '_DEBUG' ],
14-
'cflags': [ '-g', '-O0', '-fwrapv' ],
14+
'cflags': [ '-g' ],
1515
'msvs_settings': {
1616
'VCCLCompilerTool': {
1717
'target_conditions': [
@@ -35,6 +35,9 @@
3535
'OTHER_CFLAGS': [ '-Wno-strict-aliasing' ],
3636
},
3737
'conditions': [
38+
['OS != "zos"', {
39+
'cflags': [ '-O0', '-fwrapv' ]
40+
}],
3841
['OS == "android"', {
3942
'cflags': [ '-fPIE' ],
4043
'ldflags': [ '-fPIE', '-pie' ]
@@ -151,7 +154,7 @@
151154
'cflags': [ '-pthreads' ],
152155
'ldflags': [ '-pthreads' ],
153156
}],
154-
[ 'OS not in "solaris android"', {
157+
[ 'OS not in "solaris android zos"', {
155158
'cflags': [ '-pthread' ],
156159
'ldflags': [ '-pthread' ],
157160
}],

deps/uv/configure.ac

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ AC_ENABLE_SHARED
2424
AC_ENABLE_STATIC
2525
AC_PROG_CC
2626
AM_PROG_CC_C_O
27-
CC_CHECK_CFLAGS_APPEND([-fvisibility=hidden])
27+
AS_IF([AS_CASE([$host_os],[openedition*], [false], [true])], [
28+
CC_CHECK_CFLAGS_APPEND([-pedantic])
29+
])
30+
CC_FLAG_VISIBILITY #[-fvisibility=hidden]
2831
CC_CHECK_CFLAGS_APPEND([-g])
2932
CC_CHECK_CFLAGS_APPEND([-std=gnu89])
30-
CC_CHECK_CFLAGS_APPEND([-pedantic])
3133
CC_CHECK_CFLAGS_APPEND([-Wall])
3234
CC_CHECK_CFLAGS_APPEND([-Wextra])
3335
CC_CHECK_CFLAGS_APPEND([-Wno-unused-parameter])
@@ -52,10 +54,11 @@ AM_CONDITIONAL([AIX], [AS_CASE([$host_os],[aix*], [true], [false])
5254
AM_CONDITIONAL([ANDROID], [AS_CASE([$host_os],[linux-android*],[true], [false])])
5355
AM_CONDITIONAL([DARWIN], [AS_CASE([$host_os],[darwin*], [true], [false])])
5456
AM_CONDITIONAL([DRAGONFLY],[AS_CASE([$host_os],[dragonfly*], [true], [false])])
55-
AM_CONDITIONAL([FREEBSD], [AS_CASE([$host_os],[freebsd*], [true], [false])])
57+
AM_CONDITIONAL([FREEBSD], [AS_CASE([$host_os],[*freebsd*], [true], [false])])
5658
AM_CONDITIONAL([LINUX], [AS_CASE([$host_os],[linux*], [true], [false])])
5759
AM_CONDITIONAL([NETBSD], [AS_CASE([$host_os],[netbsd*], [true], [false])])
5860
AM_CONDITIONAL([OPENBSD], [AS_CASE([$host_os],[openbsd*], [true], [false])])
61+
AM_CONDITIONAL([OS390], [AS_CASE([$host_os],[openedition*], [true], [false])])
5962
AM_CONDITIONAL([SUNOS], [AS_CASE([$host_os],[solaris*], [true], [false])])
6063
AM_CONDITIONAL([WINNT], [AS_CASE([$host_os],[mingw*], [true], [false])])
6164
AS_CASE([$host_os],[mingw*], [

deps/uv/docs/src/errors.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ In libuv errors are negative numbered constants. As a rule of thumb, whenever
88
there is a status parameter, or an API functions returns an integer, a negative
99
number will imply an error.
1010

11+
When a function which takes a callback returns an error, the callback will never
12+
be called.
13+
1114
.. note::
1215
Implementation detail: on Unix error codes are the negated `errno` (or `-errno`), while on
1316
Windows they are defined by libuv to arbitrary negative numbers.

0 commit comments

Comments
 (0)