EAI_NODATA and some other getaddrinfo() error codes are returned by
glibc but not exposed in the headers unless _GNU_SOURCE is defined.
Only define in src/uv-common.c because that's the only file that deals
with EAI_* error codes.
Passing or returning structs as values makes life hard for people that
work with libuv through a foreign function interface. Switch to a
pointer-based approach.
Fixes#684.
Passing or returning structs as values makes life hard for people that
work with libuv through a foreign function interface. Switch to a
pointer-based approach.
Fixes#684.
Passing or returning structs as values makes life hard for people that
work with libuv through a foreign function interface. Switch to a
pointer-based approach.
Fixes#684.
Passing or returning structs as values makes life hard for people that
work with libuv through a foreign function interface. Switch to a
pointer-based approach.
Fixes#684.
Passing or returning structs as values makes life hard for people that
work with libuv through a foreign function interface. Switch to a
pointer-based approach.
Fixes#684.
Passing or returning structs as values makes life hard for people that
work with libuv through a foreign function interface. Switch to a
pointer-based approach.
Fixes#684.
Passing or returning structs as values makes life hard for people that
work with libuv through a foreign function interface. Switch to a
pointer-based approach.
Fixes#684.
Passing or returning structs as values makes life hard for people that
work with libuv through a foreign function interface. Switch to a
pointer-based approach.
Fixes#684.
Passing or returning structs as values makes life hard for people that
work with libuv through a foreign function interface. Switch to a
pointer-based approach.
Fixes#684.
A couple of issues prevented uv_shutdown() from working correctly with
write-only pipes.
* The pipe handle wasn't opened with the right permissions, so an
attempt to probe the state of the write buffer would fail with
ERROR_ACCESS_DENIED.
* The pipe flags for child process stdio pipes were always set to
UV_HANDLE_READABLE and UV_HANDLE_WRITABLE, even in cases where it
was actually half-duplex.
* There was no code path that lead to closing the pipe handle if the
pipe was write-only.
Work around an 'initializer element is not constant' build error in
src/unix/fsevents.c by turning the const int flags into #defines.
Only an issue on OS X 10.6 due to the old compiler it uses.
Fixes#908.
Load the required symbols at run-time rather than linking against the
CoreFoundation (and CoreServices and ApplicationServices) frameworks
at build time.
Should make integration easier for people that bundle libuv with their
own projects because they no longer have to replicate magic -framework
incantations in their top-level build system.
Assert that the request queue is empty when destroying the event loop.
Should catch errors where people call uv_loop_delete() when there are
still in-progress work requests (for example.)
On older mingw installations, DEVICE_TYPE isn't defined. This was
redefined in windows.h, but it was done after it was already attempted
to be used. This moves the #define for DEVICE_TYPE above the usage of
it in windows.h to prevent compilation failures.
Default CC to `gcc` instead of `cc` because at least on the mingw
installation I had there was no `cc` executable. This avoids having
to type `CC=gcc` in all the `make` commands.
Also append to `CFLAGS` instead of defining if not previously defined.
These flags are required to build libuv, so they should not be
overridden if other extra CFLAGS are supplied via the command
line as well.
Uses the pthread_key_{create,delete} and pthread_{get,set}specific
functions on UNIX platforms, Tls{Alloc,Free} and Tls{Get,Set}Value
on Windows.
Fixes#904.
Mention that:
* these functions set the SO_REUSEADDR and SO_REUSEPORT socket flags,
* what the effect of those flags is, and
* that we may remove it someday
On the BSDs, SO_REUSEPORT is pretty much SO_REUSEADDR with some special
casing for IP multicast. When two processes (that don't do multicast)
bind to the same address, only the last one receives traffic. It allows
one to "steal" the bound address from another process. (Both processes
have to enable SO_REUSEPORT though, so it only works in a cooperative
setting.)
On Linux however, it enables port sharing, not stealing - both processes
receive a share of the traffic. This is a desirable trait but pre-3.9
kernels don't support the socket option and a libuv program therefore
behaves differently with older kernels or on another platform.
The difference in behavior (sharing vs. stealing) is, in my opinion,
big enough and confusing enough that it merits a rollback. People
that want this kind of functionality can prepare the socket manually
and hand it off to uv_udp_open().
This commit effectively reverts commit 17452cd.
Compile libuv without -D_GNU_SOURCE, remove mention from the README.
The only place where it's still used is in the test suite and only
because test/test-fs.c uses struct stat directly.
* windows: Re-implement uv_fs_stat. The st_ctime field now contains the
change time, not the creation time, like on unix systems. st_dev,
st_ino, st_blocks and st_blksize are now also filled out. (Bert
Belder)
* linux: fix setsockopt(SO_REUSEPORT) error handling (Ben Noordhuis)
* windows: report uv_process_t exit code correctly (Bert Belder)
* windows: make uv_fs_chmod() report errors correctly (Bert Belder)
* windows: make some more NT apis available for libuv's internal use
(Bert Belder)
* windows: squelch some compiler warnings (Bert Belder)
This improves the output of uv_fs_stat:
* `st_ctime` now contains the change time, not the creation time.
* `st_ino` is now filled in with an fs-specific unique number.
* `st_dev` is set to the serial number of the containing file system.
* `st_blocks` now gets set.
* `st_blksize` is no longer zero, but set to a reasonable default.
This commit adds bootstrap code, function signatures, struct definitions
etc. to make it possible for libuv to use NtQueryVolumeInformationFile.
Most of this comes from the NT DDK, which libuv mirrors so that people
don't need the DDK to compile it.
Before this patch libuv would attempt to use GetLastError() to retrieve
the cause of NtQueryInformationFile failure, but that's not how it
should be done.
Linux as of 3.9 has a SO_REUSEPORT option that is similar but not
identical to its BSD counterpart.
On the BSDs, it turns on SO_REUSEADDR _and_ makes it possible to share
the address and port across processes.
On Linux, it "merely" enables fair load distribution - port sharing
still requires that you set SO_REUSEADDR.
Fair distribution is a desirable trait but not an essential one.
We don't know in advance whether the kernel actually supports
SO_REUSEPORT so don't treat EINVAL or ENOPROTOOPT as errors.
As an aside, on the BSDs we now omit the setsockopt(SO_REUSEADDR)
system call because it's implied by SO_REUSEPORT.
Fixes#870.