#include "uv.h"
#include "internal.h"
#include <FindDirectory.h>
#include <OS.h>
Go to the source code of this file.
◆ uv_cpu_info()
Definition at line 113 of file haiku.c.
114 cpu_topology_node_info* topology_infos;
125 status = get_cpu_topology_info(
NULL, &topology_count);
129 topology_infos =
uv__malloc(topology_count *
sizeof(*topology_infos));
130 if (topology_infos ==
NULL)
133 status = get_cpu_topology_info(topology_infos, &topology_count);
140 for (
i = 0;
i < (
int)topology_count;
i++) {
141 if (topology_infos[
i].
type == B_TOPOLOGY_CORE) {
142 cpuspeed = topology_infos[
i].data.core.default_frequency;
149 status = get_system_info(&system);
153 *cpu_infos =
uv__calloc(system.cpu_count,
sizeof(**cpu_infos));
154 if (*cpu_infos ==
NULL)
158 cpu_info = *cpu_infos;
159 for (
i = 0;
i < (
int)system.cpu_count;
i++) {
161 cpu_info->
speed = (
int)(cpuspeed / 1000000);
164 *
count = system.cpu_count;
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
static const char struct stat static buf struct stat static buf static vhangup int status
char * uv__strdup(const char *s)
void * uv__malloc(size_t size)
void * uv__calloc(size_t count, size_t size)
References count, i, int, uv_cpu_info_s::model, NULL, uv_cpu_info_s::speed, status, type, uv__calloc(), UV__ERR, uv__free(), uv__malloc(), and uv__strdup().
◆ uv_exepath()
int uv_exepath |
( |
char * |
buffer, |
|
|
size_t * |
size |
|
) |
| |
Definition at line 36 of file haiku.c.
37 char abspath[B_PATH_NAME_LENGTH];
51 if (abspath_len >= 0 && *
size > (
size_t)abspath_len)
ssize_t uv__strscpy(char *d, const char *s, size_t n)
static WCHAR * find_path(WCHAR *env)
References find_path(), NULL, status, UV__ERR, and uv__strscpy().
◆ uv_get_constrained_memory()
uint64_t uv_get_constrained_memory |
( |
void |
| ) |
|
◆ uv_get_free_memory()
Definition at line 58 of file haiku.c.
62 status = get_system_info(&sinfo);
66 return (sinfo.max_pages - sinfo.used_pages) * B_PAGE_SIZE;
References status.
◆ uv_get_total_memory()
Definition at line 70 of file haiku.c.
74 status = get_system_info(&sinfo);
78 return sinfo.max_pages * B_PAGE_SIZE;
References status.
◆ uv_loadavg()
void uv_loadavg |
( |
double |
avg[3] | ) |
|
◆ uv_resident_set_memory()
Definition at line 87 of file haiku.c.
99 while (get_next_area_info(thread.team, &cookie, &area) == B_OK)
100 *rss += area.ram_size;
static PTHREAD_ITEM find_thread(RzDebug *dbg, int tid)
References find_thread(), NULL, status, and UV__ERR.
◆ uv_uptime()
int uv_uptime |
( |
double * |
uptime | ) |
|
Definition at line 106 of file haiku.c.
108 *uptime = (double)system_time() / 1000000;