Commit Graph

11 Commits

Author SHA1 Message Date
Pekka Nikander
695afe8322
unix,win: add uv_if_{indextoname,indextoiid}
uv_if_indextoname() is used to convert an IPv6 scope_id
to an interface identifier string such as %eth0 or %lo.

uv_if_indextoiid() returns an IPv6 interface identifier.
On Unix it calls uv_if_indextoname(). On Windows it uses
snprintf() to return the numeric interface identifier as
a string.

Refs: https://github.com/nodejs/node/pull/14500
PR-URL: https://github.com/libuv/libuv/pull/1445
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-06 09:54:47 -05:00
Brad King
6398251aff cygwin: implement support for cygwin and msys2
Cygwin and MSYS2 are POSIX layers implemented on top of Windows.
Use our POSIX `poll(2)` implementation of our poll abstraction.
For most other components we already have dedicated sources
implementing them in terms of APIs available on Cygwin or
providing non-implementations of components not supported.

This leaves only three components that need Cygwin-specific
implementations:

* uv_uptime: implement using sysinfo
* uv_resident_set_memory: add a placeholder returning UV_ENOSYS
* uv_cpu_info: add a placeholder returning UV_ENOSYS

Update our test suite to account for features not available
due to Cygwin platform limitations or our placeholders.

PR-URL: https://github.com/libuv/libuv/pull/1312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-05-21 16:12:21 +02:00
Saúl Ibarra Corretgé
cdc10a907a test: remove LOG and LOGF variadic macros
Initial patch by @simar7, thanks!

PR-URL: https://github.com/libuv/libuv/pull/313
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-04-12 18:44:34 +02:00
Saúl Ibarra Corretgé
4fac9427e4 unix, windows: fix parsing scoped IPv6 addresses
Signed-off-by: Saúl Ibarra Corretgé <saghul@gmail.com>
2014-05-25 23:30:46 +02:00
Saúl Ibarra Corretgé
fa0e1e5071 unix, windows: remove unneeded define 2014-05-08 09:08:33 +02:00
Fedor Indutny
2b21419242 inet: allow scopeid in uv_inet_pton
We already support it in `uv_ip6_addr` anyway.

See https://github.com/joyent/node/issues/7395
2014-04-14 15:47:50 +04:00
Ben Noordhuis
8184076879 include: uv_ip[46]_addr now takes sockaddr_in*
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.
2013-09-01 08:02:07 +02:00
Ben Noordhuis
dfce87c94f test: simplify test-ip6-addr.c
Drop the callback-driven approach in favor of a simple loop. Reduces
the line count and makes the flow of execution a little easier to
follow.
2013-08-19 22:37:48 +02:00
Ben Noordhuis
96f32a206b test: replace sprintf() with snprintf()
There is zero risk of overflowing the buffer, it's just a good habit.
2013-08-05 01:16:34 +02:00
Ben Noordhuis
3ee4d3f183 unix, windows: return error codes directly
This commit changes the libuv API to return error codes directly rather
than storing them in a loop-global field.

A code snippet like this one:

    if (uv_foo(loop) < 0) {
      uv_err_t err = uv_last_error(loop);
      fprintf(stderr, "%s\n", uv_strerror(err));
    }

Should be rewritten like this:

    int err = uv_foo(loop);
    if (err < 0)
      fprintf(stderr, "%s\n", uv_strerror(err));

The rationale for this change is that it should make creating bindings
for other languages a lot easier: dealing with struct return values is
painful with most FFIs and often downright buggy.
2013-07-07 09:51:00 +02:00
Miroslav Bajtoš
fd45f876ff linux,darwin,win: link-local IPv6 addresses
Modified uv_ip6_addr() to fill sin6_scope_id for link-local addresses.

Fixes #271

Conflicts:
	build.mk
2013-07-04 15:43:20 +02:00