/* Copyright libuv project contributors. All rights reserved.1*2* Permission is hereby granted, free of charge, to any person obtaining a copy3* of this software and associated documentation files (the "Software"), to4* deal in the Software without restriction, including without limitation the5* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or6* sell copies of the Software, and to permit persons to whom the Software is7* furnished to do so, subject to the following conditions:8*9* The above copyright notice and this permission notice shall be included in10* all copies or substantial portions of the Software.11*12* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR13* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,14* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE15* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER16* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING17* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS18* IN THE SOFTWARE.19*/2021#include "uv.h"22#include "internal.h"2324#include <sys/sysinfo.h>25#include <unistd.h>2627int uv_uptime(double* uptime) {28struct sysinfo info;2930if (sysinfo(&info) < 0)31return UV__ERR(errno);3233*uptime = info.uptime;34return 0;35}3637int uv_resident_set_memory(size_t* rss) {38/* FIXME: read /proc/meminfo? */39*rss = 0;40return 0;41}4243int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {44/* FIXME: read /proc/stat? */45*cpu_infos = NULL;46*count = 0;47return UV_ENOSYS;48}4950uint64_t uv_get_constrained_memory(void) {51return 0; /* Memory constraints are unknown. */52}535455