summaryrefslogtreecommitdiff
path: root/deps/uv/src/unix/linux-core.c
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2016-10-24 22:13:07 -0400
committercjihrig <cjihrig@gmail.com>2016-10-26 09:42:41 -0400
commit63243bcb330408d511b3945c53719425d8b7abb8 (patch)
treef24252040adcc8c1a1dda22965fec39ac8df72de /deps/uv/src/unix/linux-core.c
parent2d472a36c1d5e565fe375185f273402f84bed528 (diff)
downloadandroid-node-v8-63243bcb330408d511b3945c53719425d8b7abb8.tar.gz
android-node-v8-63243bcb330408d511b3945c53719425d8b7abb8.tar.bz2
android-node-v8-63243bcb330408d511b3945c53719425d8b7abb8.zip
deps: upgrade libuv to 1.10.0
Fixes: https://github.com/nodejs/node/issues/4351 Fixes: https://github.com/nodejs/node/issues/6763 Refs: https://github.com/nodejs/node/pull/8280 PR-URL: https://github.com/nodejs/node/pull/9267 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'deps/uv/src/unix/linux-core.c')
-rw-r--r--deps/uv/src/unix/linux-core.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/deps/uv/src/unix/linux-core.c b/deps/uv/src/unix/linux-core.c
index b48a111170..58dd813ddf 100644
--- a/deps/uv/src/unix/linux-core.c
+++ b/deps/uv/src/unix/linux-core.c
@@ -289,11 +289,13 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
if (nfds == 0) {
assert(timeout != -1);
- timeout = real_timeout - timeout;
- if (timeout > 0)
- continue;
+ if (timeout == 0)
+ return;
- return;
+ /* We may have been inside the system call for longer than |timeout|
+ * milliseconds so we need to update the timestamp to avoid drift.
+ */
+ goto update_timeout;
}
if (nfds == -1) {
@@ -484,12 +486,20 @@ int uv_exepath(char* buffer, size_t* size) {
uint64_t uv_get_free_memory(void) {
- return (uint64_t) sysconf(_SC_PAGESIZE) * sysconf(_SC_AVPHYS_PAGES);
+ struct sysinfo info;
+
+ if (sysinfo(&info) == 0)
+ return (uint64_t) info.freeram * info.mem_unit;
+ return 0;
}
uint64_t uv_get_total_memory(void) {
- return (uint64_t) sysconf(_SC_PAGESIZE) * sysconf(_SC_PHYS_PAGES);
+ struct sysinfo info;
+
+ if (sysinfo(&info) == 0)
+ return (uint64_t) info.totalram * info.mem_unit;
+ return 0;
}