Commit Graph

156 Commits

Author SHA1 Message Date
Ben Noordhuis
087c461ee9 unix: make uv_fs_read() fill all buffers
The fallback for systems that lack preadv() only filled the first
buffer.

This commit rectifies that to fill all (or at least as many as possible)
buffers.

Fixes: https://github.com/libuv/libuv/issues/2332
PR-URL: https://github.com/libuv/libuv/pull/2338
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2019-06-20 12:06:31 +02:00
Anna Henningsen
ee24ce900e
unix: return actual error from uv_try_write()
So far, for some (?) errors, `uv_try_write()` returns `EAGAIN`
regardless of the actual error, so `ECONNRESET` and `EPIPE` errors
can be swallowed here.

This commit changes `uv_try_write()` so that it prefers to return
the actual error it has seen.

PR-URL: https://github.com/libuv/libuv/pull/2321
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2019-06-10 15:17:21 +02:00
Leorize
abe4f3d58d build, core, unix: add support for Haiku
This commit add support for Haiku, an open-source operating system
inspired by BeOS.

PR-URL: https://github.com/libuv/libuv/pull/2301
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-06-07 09:57:06 +02:00
Ben Noordhuis
3a1be72532 linux: read free/total memory from /proc/meminfo
It was reported that uv_get_free_memory() and uv_get_total_memory()
report the wrong values inside an lxc container.

Libuv calls sysinfo(2) but that isn't intercepted by lxc. /proc/meminfo
however is because /proc is a FUSE fs inside the container.

This commit makes libuv try /proc/meminfo first and fall back to
sysinfo(2) in case /proc isn't mounted.

Fixes: https://github.com/libuv/libuv/issues/2249
PR-URL: https://github.com/libuv/libuv/pull/2258
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-04-23 11:49:37 +02:00
Jameson Nash
0da05ce652
distcheck: remove duplicate test/ entry
It can be confusing to distcheck that we list it explicitly,
since it already adds it automatically, and we have configure
and build products in there.

Fixes: https://github.com/libuv/libuv/issues/2199
Refs: https://github.com/libuv/libuv/issues/2198
PR-URL: https://github.com/libuv/libuv/pull/2229
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-04-11 10:17:51 -04:00
Ben Noordhuis
3c521dedb4
build: partially revert 5234b1c43a
This undoes the changes commit 5234b1c4 ("build,sunos: better handling
of non-GCC compiler") makes to configure.ac and Makefile.am because they
break the build on the centos6 buildbots with the following error:

    # <snip>
    checking for _FILE_OFFSET_BITS value needed for large files... no
    ./configure: line 12957: syntax error near unexpected token `;'
    ./configure: line 12957: `; then'
    Build step 'Execute shell' marked build as failure

Refs: https://github.com/libuv/libuv/pull/2200
PR-URL: https://github.com/libuv/libuv/pull/2234
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2019-04-11 09:14:09 -04:00
cjihrig
99440bb673
unix,win: add uv_fs_{open,read,close}dir()
Co-authored-by: Julien Gilli <jgilli@nodejs.org>
Co-authored-by: Jeremy Whitlock <jwhitlock@apache.org>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/libuv/libuv/pull/2057
Refs: https://github.com/joyent/libuv/issues/1430
Refs: https://github.com/joyent/libuv/pull/1521
Refs: https://github.com/joyent/libuv/pull/1574
Refs: https://github.com/libuv/libuv/pull/175
Refs: https://github.com/nodejs/node/issues/583
Refs: https://github.com/libuv/libuv/pull/416
Refs: https://github.com/libuv/libuv/issues/170
2019-03-26 18:47:51 -04:00
cjihrig
575d41481e
unix,win: add uv_gettimeofday()
PR-URL: https://github.com/libuv/libuv/pull/2221
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-03-25 20:23:49 -04:00
Andrew Paprocki
5234b1c43a
build,sunos: better handling of non-GCC compiler
`AC_PROG_CC` sets the `GCC` shell variable, which is supposed to be
used to enable GCC-specific options.  A `GCC` check is added to only
pass the pre-existing GCC-specific options when using GCC.

The `GCC` variable is passed as an `AM_CONDITIONAL` and is used in
`Makefile.am` is used to address the following:

- Only pass `-pthreads` on `SUNOS` when using GCC
- Only use `-Wno-long-long` when using GCC

With the above changes, the Solaris build is now fixed when using the
native Studio compiler along with the minor adjustments:

- Always pass `-D_REENTRANT` to get thread-safe `errno`

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-03-16 13:20:58 -04:00
cjihrig
bc36f0c34a
build: add missing header
Refs: https://github.com/libuv/libuv/pull/2198#issuecomment-466118047
PR-URL: https://github.com/libuv/libuv/pull/2219
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-03-16 13:11:45 -04:00
Ben Noordhuis
1a33dcb11b
build: add android-configure scripts to EXTRA_DIST
Commit baa81465a ("build: add compile for android arm64/x86/x86-64")
introduced a number of new android-configure scripts but didn't add
them to EXTRA_DIST in Makefile.am, causing `make dist` to fail.

This commit also removes checkspare.sh from EXTRA_DIST. I broke that
in commit a7a16219d ("unix: remove checksparse.sh") from last June.
Mea culpa!

Fixes: https://github.com/libuv/libuv/issues/2190
PR-URL: https://github.com/libuv/libuv/pull/2198
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-03-16 12:34:10 -04:00
Santiago Gimeno
90415a3394
udp: add support for UDP connected sockets
Add two new methods:

`uv_udp_connect()` to connect / disconnect an UDP handle.
`uv_udp_getpeername()` to get the remote peer address of a connected UDP
handle.

Modify `uv_udp_send()` and `uv_udp_try_send()` to accept a `NULL` `addr`
to send messages over an "UDP connection".

Refs: https://github.com/libuv/leps/pull/10
PR-URL: https://github.com/libuv/libuv/pull/1872
Backport-PR-URL: https://github.com/libuv/libuv/pull/2217
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-03-16 12:05:37 -04:00
erw7
7ed1eced31
win: fix duplicate tty vt100 fn key
Refs: https://github.com/libuv/libuv/pull/2114
Refs: https://github.com/nodejs/node/issues/25875
Refs: https://github.com/nodejs/node/issues/26013
Fixes: https://github.com/libuv/libuv/issues/2168
PR-URL: https://github.com/libuv/libuv/pull/2160
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-02-10 10:04:18 -05:00
cjihrig
778553569f
Revert "ibmi: add support for IBM i to autotools build"
This reverts commit ca02c36c6d.
This broke SmartOS compilation in the CI.

Refs: https://github.com/libuv/libuv/pull/2148
PR-URL: https://github.com/libuv/libuv/pull/2156
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2019-01-18 10:04:14 -05:00
cjihrig
636acdda62
build: wrap long lines in Makefile.am
PR-URL: https://github.com/libuv/libuv/pull/2151
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-01-17 11:37:04 -05:00
Kevin Adler
ca02c36c6d
ibmi: add support for IBM i to autotools build
PR-URL: https://github.com/libuv/libuv/pull/2148
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-01-17 11:11:08 -05:00
cjihrig
d4288bbeab
unix,win: add uv_os_uname()
Fixes: https://github.com/libuv/libuv/issues/2126
PR-URL: https://github.com/libuv/libuv/pull/2128
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-01-14 10:47:20 -05:00
Ben Noordhuis
8972e65bf5 unix: harden string copying, introduce strscpy()
Replace calls to strcpy() and strncpy() with the newly introduced
uv__strscpy() function that is meticulous about zero-terminating
the destination buffer.

PR-URL: https://github.com/libuv/libuv/pull/2065
Refs: https://www.kernel.org/doc/htmldocs/kernel-api/API-strscpy.html
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-12-04 17:08:09 +01:00
Ben Noordhuis
6dd44caa35 unix,win: support IDNA 2008 in uv_getaddrinfo()
Encode domain names before passing them on to the libc resolver.
Some getaddrinfo() implementations support IDNA 2008, some only
IDNA 2003 and some don't support i18n domain names at all.

This is a potential security issue because it means a domain name
might resolve differently depending on the system that libuv is
running on.

Fixes: https://github.com/libuv/libuv/issues/2028
PR-URL: https://github.com/libuv/libuv/pull/2046
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-10-30 20:50:23 +01:00
Santiago Gimeno
d0b15844dd
core,bsd: refactor process_title functions
Use `setproctitle()` in `FreeBSD` as in the other `BSD` flavours.
Move `uv_setup_args()`, `uv_set_process_title()` and `uv_get_process_title()` to
`bsd-proctitle.c` so it's used by the supported BSDs.

PR-URL: https://github.com/libuv/libuv/pull/2042
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-10-18 10:11:40 +02:00
Samuel Thibault
1d1969adcc
unix: add support for GNU/Hurd
PR-URL: https://github.com/libuv/libuv/pull/2008
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

Bug-Debian: https://bugs.debian.org/881882
2018-10-11 12:14:36 +02:00
Carlo Marcelo Arenas Belón
672b96fab4
win: remove req.c and other cleanup
PR-URL: https://github.com/libuv/libuv/pull/2018
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-10-08 11:06:15 -04:00
Ben Noordhuis
56702e08bf unix: rework thread barrier implementation
* dissolve include/uv/pthread-barrier.h

* use libuv mutexes and condition variables, not pthreads's

* drive-by cleanup and simplification enabled by the first two items

PR-URL: https://github.com/libuv/libuv/pull/2019
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-10-08 11:14:41 +02:00
cjihrig
e57e07172e
unix,win: add uv_os_{get,set}priority()
Refs: https://github.com/nodejs/node/pull/21675
PR-URL: https://github.com/libuv/libuv/pull/1945
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-08-15 09:17:55 -04:00
Ben Noordhuis
95c5bf8db1 unix,win: merge timers implementation
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>
2018-06-25 23:48:15 +02:00
Saúl Ibarra Corretgé
3045fe1242 build,win: remove MinGW Makefile
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>
2018-06-14 18:40:13 +02:00
Ben Noordhuis
454ab3e137 build: fix cygwin install
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>
2018-06-14 18:40:11 +02:00
Saúl Ibarra Corretgé
99ae3edf28 core: move all include files except uv.h to uv/
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>
2018-06-14 18:39:32 +02:00
Bert Belder
421d7571a3
test: add test for IPC deadlock on Windows (#1099)
PR-URL: https://github.com/libuv/libuv/pull/1843
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2018-05-29 13:01:59 -07:00
Ben Noordhuis
b0f3310bb1 Revert "unix,fs: fix for potential partial reads/writes"
This commit has been reported as introducing a backwards-incompatible
change in reading from stdin and is independently suspected of breaking
the Node.js test suite on MacOS and maybe other platforms, possibly in
combination with commit fd049399 ("unix,tcp: avoid marking server
sockets connected".)

This reverts commit 14bfc27e64.

Fixes: https://github.com/libuv/libuv/issues/1716
Fixes: https://github.com/libuv/libuv/issues/1720
Fixes: https://github.com/nodejs/node/issues/18225
PR-URL: https://github.com/libuv/libuv/pull/1717
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2018-01-19 17:51:08 +01:00
Ben Wijen
14bfc27e64
unix,fs: fix for potential partial reads/writes
Added a check in uv__fs_buf_iter to detect partial reads and writes.
Partial reads and writes are looped until all data has been processed.

PR-URL: https://github.com/libuv/libuv/pull/640
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2018-01-10 17:14:53 +01:00
Ben Noordhuis
8156f15e82 build: install libuv.pc unconditionally
It was requested and I can't see a reason not to.

Fixes: https://github.com/libuv/libuv/issues/1684
PR-URL: https://github.com/libuv/libuv/pull/1685
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2018-01-09 14:22:46 +01:00
Bartosz Sosnowski
2b32e77bb6 win: map 0.0.0.0 and :: addresses to localhost
On Linux when connecting IP addresses 0.0.0.0 and :: are automatically
converted to localhost. This adds same functionality to Windows.

PR-URL: https://github.com/libuv/libuv/pull/1515
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-12-28 10:42:11 +01:00
John Barboza
b01de7341f
zos: implement uv_fs_event* functions
This commit uses the Register File Interest feature on z/OS
to enable users to monitor file system events.
The poll call is used to check for file descriptors as well
as a message queue that z/OS will report file system events
on. The last item on the list used by poll will contain the
message queue id instead of a file descriptor.

Limitation:
Writes to a directory (that is, file creation and deletion)
do not generate a change message for a registered directory.

PR-URL: https://github.com/libuv/libuv/pull/1311
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-12-15 11:04:16 +01:00
Matt Harrison
8a6d1b32c5 unix: make get(set)_process_title MT-safe
Used a shared uv_mutex_t in unix implementations of these functions
to prevent simultaneous execution.

Fixes: https://github.com/libuv/libuv/issues/271
PR-URL: https://github.com/libuv/libuv/pull/1640
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-12-02 12:06:34 +01:00
Anna Henningsen
0d6525acae core: add getter/setter functions for easier ABI compat
Add getter/setter functions for the fields of public structs that
might be relevant to e.g. Node.js addons.

Through these methods, ABI compatibility for a subset of the ABI
is easier to achieve, since using them makes code independent
of the exact offsets of these fields.

The intended use case that prompted this are N-API addons for
Node.js, which look for more long-term ABI compatibility guarantees
than typical Node code. With these helper functions, using libuv
directly should no longer be an obstacle for such addons.

PR-URL: https://github.com/libuv/libuv/pull/1657
Refs: https://github.com/nodejs/node/issues/13512
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-12-02 09:51:25 +01:00
Xu Meng
bb3d093bbb ibmi: add support for new platform
Support the IBM i platform.

- add a new file src/unix/ibmi.c
- extract the common functions from /src/unix/aix.c into aix-common.c
- update uv.gyp and include/uv-unix.h to enable the new file ibmi.c

PR-URL: https://github.com/libuv/libuv/pull/1601
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-11-22 12:18:04 +01:00
Bartosz Sosnowski
fd02ab681b pipe: allow access from other users
Adds new uv_pipe_chmod function which can be used to make the pipe
writable or readable by all users.

PR-URL: https://github.com/libuv/libuv/pull/1386
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-06 15:45:00 +01:00
Joel Winarske
ce41af28c8 cygwin: include uv-posix.h header
Fixes: https://github.com/libuv/libuv/issues/1480
PR-URL: https://github.com/libuv/libuv/pull/1482
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-08-19 21:41:17 +02:00
cjihrig
766d7e9c0b
unix, windows: add basic uv_fs_copyfile()
Fixes: https://github.com/libuv/libuv/issues/925
PR-URL: https://github.com/libuv/libuv/pull/1465
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-08-15 10:43:49 -04:00
Saúl Ibarra Corretgé
7dabd57af4 android: fix compilation with new NDK versions
Fixes compiling with Android NDK when using Unified Headers (default
since r15).

Fixes: https://github.com/libuv/libuv/issues/1417
PR-URL: https://github.com/libuv/libuv/pull/1433
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-07-25 22:50:39 +02:00
Saúl Ibarra Corretgé
e25b5a5b2c zos: remove nonexistent include from autotools build
PR-URL: https://github.com/libuv/libuv/pull/1432
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-07-25 00:03:56 +02:00
CurlyMoo
d731fd1bd9 poll: add support for OOB TCP and GPIO interrupts
Out-of-band TCP messages are used for TCP data
transmission outside (outband) the inbound TCP
data. These packets are sent with an
"urgent pointer", but previously discarded.

Additionally, when using (e)poll a POLLPRI is
triggered when an interrupt signal is received
on GPIO capable systems such as the Raspberry Pi.

PR-URL: https://github.com/libuv/libuv/pull/1040
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-07-12 23:04:34 +02: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
Brad King
77326e86a2 unix: factor out reusable procfs exepath impl
On Linux we read `/proc/self/exe` for the path to the executable.
Factor out a dedicated source file to make this implementation
available for use on other platforms that support it.

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:18 +02:00
Brad King
76bcf9f91d unix: factor out reusable sysinfo loadavg impl
On Linux we use `sysinfo(2)` to look up the load average.
Factor out a dedicated source file to make this implementation
available for use on other platforms that support it.

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:16 +02:00
Brad King
ea795b29ef unix: factor out reusable sysinfo memory lookup
On Linux we use `sysinfo(2)` to look up available memory.
Factor out a dedicated source file to make this implementation
available for use on other platforms that support it.

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:14 +02:00
Brad King
32ef58bf72 unix: factor out reusable no-fsevents impl
On os390 we implement no support for fsevents.  Other platforms may not
support fsevents either, so provide a dedicated source file to use in
this case.

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:11 +02:00
Brad King
470b0258b0 unix: factor out reusable no-proctitle impl
On SunOS we implement no support for proctitle.  Other platforms may not
support proctitle either, so provide a dedicated source file to use in
this case.

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:11:33 +02:00
cjihrig
d8cd08bd98 unix,win: add uv_os_gethostname()
Fixes: https://github.com/libuv/libuv/issues/1315
PR-URL: https://github.com/libuv/libuv/pull/1342
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-05-18 10:27:47 -04:00