diff options
author | libuv upstream <libuv@googlegroups.com> | 2017-05-25 15:51:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-05-26 17:33:40 (GMT) |
commit | 362435f02a52008a90a1c19862f09b01f1b5bd7f (patch) | |
tree | 8f63df70d3742bd44cd7a3240bc59aa1d447a08c /src/unix/cygwin.c | |
parent | 12a78bc824655524d817508d6107ef4dcf8e3626 (diff) | |
download | CMake-362435f02a52008a90a1c19862f09b01f1b5bd7f.zip CMake-362435f02a52008a90a1c19862f09b01f1b5bd7f.tar.gz CMake-362435f02a52008a90a1c19862f09b01f1b5bd7f.tar.bz2 |
libuv 2017-05-25 (dc596109)
Code extracted from:
https://github.com/libuv/libuv.git
at commit dc596109d5a22db1dbf57098630eebd30fce8068 (v1.x).
Diffstat (limited to 'src/unix/cygwin.c')
-rw-r--r-- | src/unix/cygwin.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/unix/cygwin.c b/src/unix/cygwin.c new file mode 100644 index 0000000..5a887dd --- /dev/null +++ b/src/unix/cygwin.c @@ -0,0 +1,54 @@ +/* Copyright libuv project contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "uv.h" +#include "internal.h" + +#include <sys/sysinfo.h> +#include <unistd.h> + +int uv_uptime(double* uptime) { + struct sysinfo info; + + if (sysinfo(&info) < 0) + return -errno; + + *uptime = info.uptime; + return 0; +} + +int uv_resident_set_memory(size_t* rss) { + /* FIXME: read /proc/meminfo? */ + *rss = 0; + return UV_ENOSYS; +} + +int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { + /* FIXME: read /proc/stat? */ + *cpu_infos = NULL; + *count = 0; + return UV_ENOSYS; +} + +void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) { + (void)cpu_infos; + (void)count; +} |