Change the position of UV_LS_LCHOWN, moving it to the end in order to go
around a bug due to it's initial position.
The original position of UV_LS_LCHOWN broke ABI compat, causing a binary
using UV_FS_REALPATH or UV_FS_COPYFILE to break, as the values point to
wrong function.
Refs: https://github.com/yarnpkg/yarn/issues/6043
Fixes: https://github.com/libuv/libuv/issues/1908
PR-URL: https://github.com/libuv/libuv/pull/1913
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Problem:
The condvar tests could pass without uv_cond_wait
(or uv_cond_timedwait) ever being invoked.
Solution:
Introduce semaphores to enforce ordering.
Now there will always be a thread waiting on the condition
when a signal() occurs.
Gotchas:
1. On Windows, waiting for a timeout may return earlier
than requested, depending on the granularity of timer ticks.
2. Timeout bounds are tuned based on our CI machines.
Bonuses:
1. I added additional test cases to complete the test matrix.
2. It seemed to me that several of the condvar tests were redundant,
because they used timing to probabilistically explore cases where there
would be "missed connections" (signal without a waiter).
Because it was not clear to me what the purpose of such tests were,
I have removed them.
Fixes: https://github.com/libuv/libuv/issues/1714
PR-URL: https://github.com/libuv/libuv/pull/1718
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This PR creates two new externally-facing APIs, uv_err_name_r() and
uv_strerror_r().
In keeping with the precedent set by POSIX, the *_r() suffix of these
two new methods indicate that the caller does the memory management and
passes in the memory that the output will be stored in, which provides
an alternative for the two existent methods (uv_err_name() and
uv_strerror()), which, when called with an unknown error code, leak a
few bytes of memory.
PR-URL: https://github.com/libuv/libuv/pull/1898
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno santiago.gimeno@gmail.com
Some long overdue refactoring that unifies more of the UNIX and Windows
backends.
PR-URL: https://github.com/libuv/libuv/pull/1904
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This is required because `poll` will not reset the flags which it isn't
polling itself.
PR-URL: https://github.com/libuv/libuv/pull/1868
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Merge src/unix/timer.c and src/win/timer.c into src/timer.c. This
changes the Windows implementation from a binary tree to a binary
heap for generally better performance.
PR-URL: https://github.com/libuv/libuv/pull/1882
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
`UV__UNUSED()` does not evaluate to nothing with MinGW, use something
else instead to squelch the unused argument warning.
PR-URL: https://github.com/libuv/libuv/pull/1882
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
I haven't it this much since its introduction in 2013. All commits
since then have been maintenance updates (adding or removing files)
so let's just remove it.
PR-URL: https://github.com/libuv/libuv/pull/1882
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This macro is not guaranteed to be present in stdlib.h and the
macro may be disabled on Windows in some situations (e.g. when
NOMINMAX is defined).
PR-URL: https://github.com/libuv/libuv/pull/1891
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This fixes a C/C++ ambiguity about whether this structure is
scoped or global.
PR-URL: https://github.com/libuv/libuv/pull/1888
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
In commit c7c8e916b8 (poll: add UV_DISCONNECT event, 2016-01-11) we
forgot to update the workaround added by commit 24bfef2ef4 (linux:
handle EPOLLHUP without EPOLLIN/EPOLLOUT, 2013-11-08). On
linux-sparc64, epoll returns just POLLHUP during part of our
`poll_duplex` and `poll_unidirectional` tests, triggering the need for
the workaround to recognize UV_DISCONNECT.
Fixes: https://github.com/libuv/libuv/issues/1859
PR-URL: https://github.com/libuv/libuv/pull/1896
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
All good things come in threes and that's why besides autotools and gyp,
you can now also build everyone's favorite platform abstraction library
with cmake.
This is Ouroboros eating its own tail in a way because cmake depends on
libuv, depends on cmake, depends on libuv, depends on... inception!
Things it does:
* build the shared library
* build the static library
* install the shared library
* install the static library
* install the header files
* install libuv.pc
Things it does not yet do:
* build or install the documentation
* build or execute the test suite
* produce a release tarball
* provide auto-config for downstream cmake-based projects
Fixes: https://github.com/libuv/libuv/issues/1362
PR-URL: https://github.com/libuv/libuv/pull/1850
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MSYS2 + MinGW-w64 have good support for autoconf, that should be the
preferred way of building libuv under MinGW.
This is a cherry-pick of commit ee949df1cb from the master branch.
PR-URL: https://github.com/libuv/libuv/pull/1850
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Use the right file path and variable name for the posix.h header file.
Introduced when commit ce41af28 ("cygwin: include uv-posix.h header")
was merged from the v1.x branch, where it is the correct path, into
the master branch.
This is a cherry-pick of commit d0c2ad39 from the master branch.
PR-URL: https://github.com/libuv/libuv/pull/1850
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This is a cherry-pick of commit d010030ad5 from the master branch.
Conflicts:
Makefile.am
include/uv.h
include/uv/unix.h
libuv.nsi (deleted)
src/unix/pthread-barrier.c (deleted)
PR-URL: https://github.com/libuv/libuv/pull/1850
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This test has been timing out on macOS. Try to avoid that by
reducing the number of iterations run.
PR-URL: https://github.com/libuv/libuv/pull/1867
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
They were only there to aid Windows XP support, which libuv no longer
does.
PR-URL: https://github.com/libuv/libuv/pull/1858
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
All Windows versions that libuv supports have GetQueuedCompletionStatusEx,
so this fallback option is no longer needed.
PR-URL: https://github.com/libuv/libuv/pull/1858
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
The fallback implementation existed to support Windows XP and Server 2003,
but these old versions of windows are no longer supporter by libuv.
PR-URL: https://github.com/libuv/libuv/pull/1852
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Libuv is not supported on Windows XP, as stated in the
SUPPORTED_PLATFORMS document. It also can't possibly work because
`ReOpenFile()` in src/win/fs.c is not weakly linked, so any executable
that links libuv would simply fail to load on XP.
This reverts commit 17eaa956bd.
Refs: https://github.com/libuv/libuv/pull/1810
PR-URL: https://github.com/libuv/libuv/pull/1854
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
We don't control the running time of the test and as a result it
frequently times out on some of the CI buildbots.
We are already using a custom timeout for getaddrinfo_fail so it only
makes sense to do the same for its synchronous counterpart.
PR-URL: https://github.com/libuv/libuv/pull/1856
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Libuv does not support multiple handles watching the same file
descriptor. That condition is caught by an assert but it's detached
from the call site and therefore not always trivial to track down.
This commit turns cases where we can easily detect duplicates into
runtime `UV_EEXIST` errors. More work is needed to catch _all_ cases.
Partially addresses https://github.com/libuv/libuv/issues/1172.
PR-URL: https://github.com/libuv/libuv/pull/1851
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>