mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:07:35 +00:00
Ports/libuv: Use new global variables at /sys/kernel/ directory
This commit is contained in:
parent
78ca32d14c
commit
c8a7a3e43f
1 changed files with 4 additions and 4 deletions
|
@ -66,9 +66,9 @@ index 0000000..5c34b75
|
||||||
+static uint64_t uv__read_proc_memstat(const char* what) {
|
+static uint64_t uv__read_proc_memstat(const char* what) {
|
||||||
+ uint64_t rc;
|
+ uint64_t rc;
|
||||||
+ char* p;
|
+ char* p;
|
||||||
+ char buf[4096]; /* Large enough to hold all of /proc/memstat. */
|
+ char buf[4096]; /* Large enough to hold all of /sys/kernel/memstat. */
|
||||||
+
|
+
|
||||||
+ if (uv__slurp("/proc/memstat", buf, sizeof(buf)))
|
+ if (uv__slurp("/sys/kernel/memstat", buf, sizeof(buf)))
|
||||||
+ return 0;
|
+ return 0;
|
||||||
+
|
+
|
||||||
+ p = strstr(buf, what);
|
+ p = strstr(buf, what);
|
||||||
|
@ -104,9 +104,9 @@ index 0000000..5c34b75
|
||||||
+ struct timespec now;
|
+ struct timespec now;
|
||||||
+ int r;
|
+ int r;
|
||||||
+
|
+
|
||||||
+ /* Try /proc/uptime first, then fallback to clock_gettime(). */
|
+ /* Try /sys/kernel/uptime first, then fallback to clock_gettime(). */
|
||||||
+
|
+
|
||||||
+ if (0 == uv__slurp("/proc/uptime", buf, sizeof(buf)))
|
+ if (0 == uv__slurp("/sys/kernel/uptime", buf, sizeof(buf)))
|
||||||
+ if (1 == sscanf(buf, "%lf", uptime))
|
+ if (1 == sscanf(buf, "%lf", uptime))
|
||||||
+ return 0;
|
+ return 0;
|
||||||
+
|
+
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue