Rizin
unix-like reverse engineering framework and cli tools
ibmi.c
Go to the documentation of this file.
1 /* Copyright libuv project contributors. All rights reserved.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to
5  * deal in the Software without restriction, including without limitation the
6  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7  * sell copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19  * IN THE SOFTWARE.
20  */
21 
22 #include "uv.h"
23 #include "internal.h"
24 
25 #include <stdio.h>
26 #include <stdint.h>
27 #include <stdlib.h>
28 #include <string.h>
29 #include <assert.h>
30 #include <errno.h>
31 
32 #include <sys/types.h>
33 #include <sys/socket.h>
34 #include <sys/ioctl.h>
35 #include <net/if.h>
36 #include <netinet/in.h>
37 #include <arpa/inet.h>
38 
39 #include <sys/time.h>
40 #include <unistd.h>
41 #include <fcntl.h>
42 #include <utmp.h>
43 #include <libgen.h>
44 
45 #include <sys/protosw.h>
46 #include <procinfo.h>
47 #include <sys/proc.h>
48 #include <sys/procfs.h>
49 
50 #include <ctype.h>
51 
52 #include <sys/mntctl.h>
53 #include <sys/vmount.h>
54 #include <limits.h>
55 #include <strings.h>
56 #include <sys/vnode.h>
57 
58 #include <as400_protos.h>
59 #include <as400_types.h>
60 
64 
65 typedef struct {
68  char current_date_and_time[8];
69  char system_name[8];
70  char elapsed_time[6];
72  char reserved;
86  int reserved1;
89  char reserved2[3];
102 } SSTS0200;
103 
104 
105 typedef struct {
106  char header[208];
107  unsigned char loca_adapter_address[12];
108 } LIND0500;
109 
110 
111 typedef struct {
114  char msgid[7];
115 } errcode_s;
116 
117 
118 static const unsigned char e2a[256] = {
119  0, 1, 2, 3, 156, 9, 134, 127, 151, 141, 142, 11, 12, 13, 14, 15,
120  16, 17, 18, 19, 157, 133, 8, 135, 24, 25, 146, 143, 28, 29, 30, 31,
121  128, 129, 130, 131, 132, 10, 23, 27, 136, 137, 138, 139, 140, 5, 6, 7,
122  144, 145, 22, 147, 148, 149, 150, 4, 152, 153, 154, 155, 20, 21, 158, 26,
123  32, 160, 161, 162, 163, 164, 165, 166, 167, 168, 91, 46, 60, 40, 43, 33,
124  38, 169, 170, 171, 172, 173, 174, 175, 176, 177, 93, 36, 42, 41, 59, 94,
125  45, 47, 178, 179, 180, 181, 182, 183, 184, 185, 124, 44, 37, 95, 62, 63,
126  186, 187, 188, 189, 190, 191, 192, 193, 194, 96, 58, 35, 64, 39, 61, 34,
127  195, 97, 98, 99, 100, 101, 102, 103, 104, 105, 196, 197, 198, 199, 200, 201,
128  202, 106, 107, 108, 109, 110, 111, 112, 113, 114, 203, 204, 205, 206, 207, 208,
129  209, 126, 115, 116, 117, 118, 119, 120, 121, 122, 210, 211, 212, 213, 214, 215,
130  216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231,
131  123, 65, 66, 67, 68, 69, 70, 71, 72, 73, 232, 233, 234, 235, 236, 237,
132  125, 74, 75, 76, 77, 78, 79, 80, 81, 82, 238, 239, 240, 241, 242, 243,
133  92, 159, 83, 84, 85, 86, 87, 88, 89, 90, 244, 245, 246, 247, 248, 249,
134  48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 250, 251, 252, 253, 254, 255};
135 
136 
137 static const unsigned char a2e[256] = {
138  0, 1, 2, 3, 55, 45, 46, 47, 22, 5, 37, 11, 12, 13, 14, 15,
139  16, 17, 18, 19, 60, 61, 50, 38, 24, 25, 63, 39, 28, 29, 30, 31,
140  64, 79, 127, 123, 91, 108, 80, 125, 77, 93, 92, 78, 107, 96, 75, 97,
141  240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 122, 94, 76, 126, 110, 111,
142  124, 193, 194, 195, 196, 197, 198, 199, 200, 201, 209, 210, 211, 212, 213, 214,
143  215, 216, 217, 226, 227, 228, 229, 230, 231, 232, 233, 74, 224, 90, 95, 109,
144  121, 129, 130, 131, 132, 133, 134, 135, 136, 137, 145, 146, 147, 148, 149, 150,
145  151, 152, 153, 162, 163, 164, 165, 166, 167, 168, 169, 192, 106, 208, 161, 7,
146  32, 33, 34, 35, 36, 21, 6, 23, 40, 41, 42, 43, 44, 9, 10, 27,
147  48, 49, 26, 51, 52, 53, 54, 8, 56, 57, 58, 59, 4, 20, 62, 225,
148  65, 66, 67, 68, 69, 70, 71, 72, 73, 81, 82, 83, 84, 85, 86, 87,
149  88, 89, 98, 99, 100, 101, 102, 103, 104, 105, 112, 113, 114, 115, 116, 117,
150  118, 119, 120, 128, 138, 139, 140, 141, 142, 143, 144, 154, 155, 156, 157, 158,
151  159, 160, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,
152  184, 185, 186, 187, 188, 189, 190, 191, 202, 203, 204, 205, 206, 207, 218, 219,
153  220, 221, 222, 223, 234, 235, 236, 237, 238, 239, 250, 251, 252, 253, 254, 255};
154 
155 
156 static void iconv_e2a(unsigned char src[], unsigned char dst[], size_t length) {
157  size_t i;
158  for (i = 0; i < length; i++)
159  dst[i] = e2a[src[i]];
160 }
161 
162 
163 static void iconv_a2e(const char* src, unsigned char dst[], size_t length) {
164  size_t srclen;
165  size_t i;
166 
167  srclen = strlen(src);
168  if (srclen > length)
169  abort();
170  for (i = 0; i < srclen; i++)
171  dst[i] = a2e[src[i]];
172  /* padding the remaining part with spaces */
173  for (; i < length; i++)
174  dst[i] = a2e[' '];
175 }
176 
179 }
180 
181 static int get_ibmi_system_status(SSTS0200* rcvr) {
182  /* rcvrlen is input parameter 2 to QWCRSSTS */
183  unsigned int rcvrlen = sizeof(*rcvr);
184  unsigned char format[8], reset_status[10];
185 
186  /* format is input parameter 3 to QWCRSSTS */
187  iconv_a2e("SSTS0200", format, sizeof(format));
188  /* reset_status is input parameter 4 */
189  iconv_a2e("*NO", reset_status, sizeof(reset_status));
190 
191  /* errcode is input parameter 5 to QWCRSSTS */
192  errcode_s errcode;
193 
194  /* qwcrssts_pointer is the 16-byte tagged system pointer to QWCRSSTS */
195  ILEpointer __attribute__((aligned(16))) qwcrssts_pointer;
196 
197  /* qwcrssts_argv is the array of argument pointers to QWCRSSTS */
198  void* qwcrssts_argv[6];
199 
200  /* Set the IBM i pointer to the QSYS/QWCRSSTS *PGM object */
201  int rc = _RSLOBJ2(&qwcrssts_pointer, RSLOBJ_TS_PGM, "QWCRSSTS", "QSYS");
202 
203  if (rc != 0)
204  return rc;
205 
206  /* initialize the QWCRSSTS returned info structure */
207  memset(rcvr, 0, sizeof(*rcvr));
208 
209  /* initialize the QWCRSSTS error code structure */
210  memset(&errcode, 0, sizeof(errcode));
211  errcode.bytes_provided = sizeof(errcode);
212 
213  /* initialize the array of argument pointers for the QWCRSSTS API */
214  qwcrssts_argv[0] = rcvr;
215  qwcrssts_argv[1] = &rcvrlen;
216  qwcrssts_argv[2] = &format;
217  qwcrssts_argv[3] = &reset_status;
218  qwcrssts_argv[4] = &errcode;
219  qwcrssts_argv[5] = NULL;
220 
221  /* Call the IBM i QWCRSSTS API from PASE */
222  rc = _PGMCALL(&qwcrssts_pointer, qwcrssts_argv, 0);
223 
224  return rc;
225 }
226 
227 
229  SSTS0200 rcvr;
230 
231  if (get_ibmi_system_status(&rcvr))
232  return 0;
233 
234  return (uint64_t)rcvr.main_storage_size * 1024ULL;
235 }
236 
237 
239  SSTS0200 rcvr;
240 
241  if (get_ibmi_system_status(&rcvr))
242  return 0;
243 
244  return (uint64_t)rcvr.main_storage_size * 1024ULL;
245 }
246 
247 
249  return 0; /* Memory constraints are unknown. */
250 }
251 
252 
253 void uv_loadavg(double avg[3]) {
254  SSTS0200 rcvr;
255 
256  if (get_ibmi_system_status(&rcvr)) {
257  avg[0] = avg[1] = avg[2] = 0;
258  return;
259  }
260 
261  /* The average (in tenths) of the elapsed time during which the processing
262  * units were in use. For example, a value of 411 in binary would be 41.1%.
263  * This percentage could be greater than 100% for an uncapped partition.
264  */
265  double processing_unit_used_percent =
266  rcvr.percent_processing_unit_used / 1000.0;
267 
268  avg[0] = avg[1] = avg[2] = processing_unit_used_percent;
269 }
270 
271 
272 int uv_resident_set_memory(size_t* rss) {
273  *rss = 0;
274  return 0;
275 }
276 
277 
278 int uv_uptime(double* uptime) {
279  return UV_ENOSYS;
280 }
281 
282 
283 int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
284  unsigned int numcpus, idx = 0;
285  uv_cpu_info_t* cpu_info;
286 
287  *cpu_infos = NULL;
288  *count = 0;
289 
290  numcpus = sysconf(_SC_NPROCESSORS_ONLN);
291 
292  *cpu_infos = uv__malloc(numcpus * sizeof(uv_cpu_info_t));
293  if (!*cpu_infos) {
294  return UV_ENOMEM;
295  }
296 
297  cpu_info = *cpu_infos;
298  for (idx = 0; idx < numcpus; idx++) {
299  cpu_info->speed = 0;
300  cpu_info->model = uv__strdup("unknown");
301  cpu_info->cpu_times.user = 0;
302  cpu_info->cpu_times.sys = 0;
303  cpu_info->cpu_times.idle = 0;
304  cpu_info->cpu_times.irq = 0;
305  cpu_info->cpu_times.nice = 0;
306  cpu_info++;
307  }
308  *count = numcpus;
309 
310  return 0;
311 }
312 
313 
314 static int get_ibmi_physical_address(const char* line, char (*phys_addr)[6]) {
315  LIND0500 rcvr;
316  /* rcvrlen is input parameter 2 to QDCRLIND */
317  unsigned int rcvrlen = sizeof(rcvr);
318  unsigned char format[8], line_name[10];
319  unsigned char mac_addr[sizeof(rcvr.loca_adapter_address)];
320  int c[6];
321 
322  /* format is input parameter 3 to QDCRLIND */
323  iconv_a2e("LIND0500", format, sizeof(format));
324 
325  /* line_name is input parameter 4 to QDCRLIND */
326  iconv_a2e(line, line_name, sizeof(line_name));
327 
328  /* err is input parameter 5 to QDCRLIND */
329  errcode_s err;
330 
331  /* qwcrssts_pointer is the 16-byte tagged system pointer to QDCRLIND */
332  ILEpointer __attribute__((aligned(16))) qdcrlind_pointer;
333 
334  /* qwcrssts_argv is the array of argument pointers to QDCRLIND */
335  void* qdcrlind_argv[6];
336 
337  /* Set the IBM i pointer to the QSYS/QDCRLIND *PGM object */
338  int rc = _RSLOBJ2(&qdcrlind_pointer, RSLOBJ_TS_PGM, "QDCRLIND", "QSYS");
339 
340  if (rc != 0)
341  return rc;
342 
343  /* initialize the QDCRLIND returned info structure */
344  memset(&rcvr, 0, sizeof(rcvr));
345 
346  /* initialize the QDCRLIND error code structure */
347  memset(&err, 0, sizeof(err));
348  err.bytes_provided = sizeof(err);
349 
350  /* initialize the array of argument pointers for the QDCRLIND API */
351  qdcrlind_argv[0] = &rcvr;
352  qdcrlind_argv[1] = &rcvrlen;
353  qdcrlind_argv[2] = &format;
354  qdcrlind_argv[3] = &line_name;
355  qdcrlind_argv[4] = &err;
356  qdcrlind_argv[5] = NULL;
357 
358  /* Call the IBM i QDCRLIND API from PASE */
359  rc = _PGMCALL(&qdcrlind_pointer, qdcrlind_argv, 0);
360  if (rc != 0)
361  return rc;
362 
363  /* convert ebcdic loca_adapter_address to ascii first */
364  iconv_e2a(rcvr.loca_adapter_address, mac_addr,
365  sizeof(rcvr.loca_adapter_address));
366 
367  /* convert loca_adapter_address(char[12]) to phys_addr(char[6]) */
368  int r = sscanf(mac_addr, "%02x%02x%02x%02x%02x%02x",
369  &c[0], &c[1], &c[2], &c[3], &c[4], &c[5]);
370 
371  if (r == ARRAY_SIZE(c)) {
372  (*phys_addr)[0] = c[0];
373  (*phys_addr)[1] = c[1];
374  (*phys_addr)[2] = c[2];
375  (*phys_addr)[3] = c[3];
376  (*phys_addr)[4] = c[4];
377  (*phys_addr)[5] = c[5];
378  } else {
379  memset(*phys_addr, 0, sizeof(*phys_addr));
380  rc = -1;
381  }
382  return rc;
383 }
384 
385 
387  uv_interface_address_t* address;
388  struct ifaddrs_pase *ifap = NULL, *cur;
389  int inet6, r = 0;
390 
391  *count = 0;
392  *addresses = NULL;
393 
394  if (Qp2getifaddrs(&ifap))
395  return UV_ENOSYS;
396 
397  /* The first loop to get the size of the array to be allocated */
398  for (cur = ifap; cur; cur = cur->ifa_next) {
399  if (!(cur->ifa_addr->sa_family == AF_INET6 ||
400  cur->ifa_addr->sa_family == AF_INET))
401  continue;
402 
403  if (!(cur->ifa_flags & IFF_UP && cur->ifa_flags & IFF_RUNNING))
404  continue;
405 
406  (*count)++;
407  }
408 
409  if (*count == 0) {
410  Qp2freeifaddrs(ifap);
411  return 0;
412  }
413 
414  /* Alloc the return interface structs */
415  *addresses = uv__calloc(*count, sizeof(**addresses));
416  if (*addresses == NULL) {
417  Qp2freeifaddrs(ifap);
418  return UV_ENOMEM;
419  }
420  address = *addresses;
421 
422  /* The second loop to fill in the array */
423  for (cur = ifap; cur; cur = cur->ifa_next) {
424  if (!(cur->ifa_addr->sa_family == AF_INET6 ||
425  cur->ifa_addr->sa_family == AF_INET))
426  continue;
427 
428  if (!(cur->ifa_flags & IFF_UP && cur->ifa_flags & IFF_RUNNING))
429  continue;
430 
431  address->name = uv__strdup(cur->ifa_name);
432 
433  inet6 = (cur->ifa_addr->sa_family == AF_INET6);
434 
435  if (inet6) {
436  address->address.address6 = *((struct sockaddr_in6*)cur->ifa_addr);
437  address->netmask.netmask6 = *((struct sockaddr_in6*)cur->ifa_netmask);
438  address->netmask.netmask6.sin6_family = AF_INET6;
439  } else {
440  address->address.address4 = *((struct sockaddr_in*)cur->ifa_addr);
441  address->netmask.netmask4 = *((struct sockaddr_in*)cur->ifa_netmask);
442  address->netmask.netmask4.sin_family = AF_INET;
443  }
444  address->is_internal = cur->ifa_flags & IFF_LOOPBACK ? 1 : 0;
445  if (!address->is_internal) {
446  int rc = get_ibmi_physical_address(address->name, &address->phys_addr);
447  if (rc != 0)
448  r = rc;
449  }
450 
451  address++;
452  }
453 
454  Qp2freeifaddrs(ifap);
455  return r;
456 }
457 
458 
460  int i;
461 
462  for (i = 0; i < count; ++i) {
463  uv__free(addresses[i].name);
464  }
465 
466  uv__free(addresses);
467 }
468 
469 char** uv_setup_args(int argc, char** argv) {
470  char exepath[UV__PATH_MAX];
471  char* s;
472  size_t size;
473 
474  if (argc > 0) {
475  /* Use argv[0] to determine value for uv_exepath(). */
476  size = sizeof(exepath);
477  if (uv__search_path(argv[0], exepath, &size) == 0) {
480  original_exepath = uv__strdup(exepath);
482  }
483  }
484 
485  return argv;
486 }
487 
488 int uv_set_process_title(const char* title) {
489  return 0;
490 }
491 
492 int uv_get_process_title(char* buffer, size_t size) {
493  if (buffer == NULL || size == 0)
494  return UV_EINVAL;
495 
496  buffer[0] = '\0';
497  return 0;
498 }
499 
501 }
#define ARRAY_SIZE(a)
lzma_index ** i
Definition: index.h:629
lzma_index * src
Definition: index.h:567
static bool err
Definition: armass.c:435
#define NULL
Definition: cris-opc.c:27
#define r
Definition: crypto_rc6.c:12
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
Definition: sflib.h:98
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 static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
Definition: sflib.h:133
static void iconv_a2e(const char *src, unsigned char dst[], size_t length)
Definition: ibmi.c:163
uint64_t uv_get_total_memory(void)
Definition: ibmi.c:238
void uv_loadavg(double avg[3])
Definition: ibmi.c:253
uint64_t uv_get_free_memory(void)
Definition: ibmi.c:228
int uv_interface_addresses(uv_interface_address_t **addresses, int *count)
Definition: ibmi.c:386
static int get_ibmi_physical_address(const char *line, char(*phys_addr)[6])
Definition: ibmi.c:314
static const unsigned char a2e[256]
Definition: ibmi.c:137
void uv__process_title_cleanup(void)
Definition: ibmi.c:500
uv_once_t process_title_mutex_once
Definition: ibmi.c:63
void init_process_title_mutex_once(void)
Definition: ibmi.c:177
char ** uv_setup_args(int argc, char **argv)
Definition: ibmi.c:469
int uv_uptime(double *uptime)
Definition: ibmi.c:278
void uv_free_interface_addresses(uv_interface_address_t *addresses, int count)
Definition: ibmi.c:459
int uv_cpu_info(uv_cpu_info_t **cpu_infos, int *count)
Definition: ibmi.c:283
uint64_t uv_get_constrained_memory(void)
Definition: ibmi.c:248
char * original_exepath
Definition: ibmi.c:61
static const unsigned char e2a[256]
Definition: ibmi.c:118
static int get_ibmi_system_status(SSTS0200 *rcvr)
Definition: ibmi.c:181
static void iconv_e2a(unsigned char src[], unsigned char dst[], size_t length)
Definition: ibmi.c:156
int uv_set_process_title(const char *title)
Definition: ibmi.c:488
int uv_get_process_title(char *buffer, size_t size)
Definition: ibmi.c:492
int uv_resident_set_memory(size_t *rss)
Definition: ibmi.c:272
uv_mutex_t process_title_mutex
Definition: ibmi.c:62
voidpf void uLong size
Definition: ioapi.h:138
return memset(p, 0, total)
#define __attribute__(x)
Definition: ansidecl.h:266
static static fork const void static count static fd const char const char static newpath char char argv
Definition: sflib.h:40
char * dst
Definition: lz4.h:724
#define header(is_bt, len_min, ret_op)
line
Definition: setup.py:34
int idx
Definition: setup.py:197
static RzSocket * s
Definition: rtr.c:28
#define AF_INET
Definition: sftypes.h:287
#define AF_INET6
Definition: sftypes.h:295
unsigned long uint64_t
Definition: sftypes.h:28
#define c(i)
Definition: sha256.c:43
Definition: ibmi.c:105
unsigned char loca_adapter_address[12]
Definition: ibmi.c:107
Definition: ibmi.c:65
int percent_system_asp_used
Definition: ibmi.c:78
int current_unprotected_storage_used
Definition: ibmi.c:80
int bytes_returned
Definition: ibmi.c:67
int percent_temporary_addresses
Definition: ibmi.c:76
int percent_temporary_256mb_segments_used
Definition: ibmi.c:94
int number_of_partitions
Definition: ibmi.c:84
int bytes_available
Definition: ibmi.c:66
int partition_identifier
Definition: ibmi.c:85
int percent_permanent_addresses
Definition: ibmi.c:75
int main_storage_size
Definition: ibmi.c:83
int system_asp
Definition: ibmi.c:77
int jobs_in_system
Definition: ibmi.c:74
int percent_permanent_256mb_segments_used
Definition: ibmi.c:96
int maximum_jobs_in_system
Definition: ibmi.c:93
int percent_processing_unit_used
Definition: ibmi.c:73
int percent_temporary_4gb_segments_used
Definition: ibmi.c:95
int percent_shared_processor_pool_used
Definition: ibmi.c:100
int percent_current_interactive_performance
Definition: ibmi.c:98
int number_of_processors
Definition: ibmi.c:90
int current_processing_capacity
Definition: ibmi.c:87
char processor_sharing_attribute
Definition: ibmi.c:88
int total_auxiliary_storage
Definition: ibmi.c:79
int active_jobs_in_system
Definition: ibmi.c:91
int percent_db_capability
Definition: ibmi.c:82
int maximum_unprotected_storage_used
Definition: ibmi.c:81
char reserved
Definition: ibmi.c:72
int reserved1
Definition: ibmi.c:86
long main_storage_size_long
Definition: ibmi.c:101
char restricted_state_flag
Definition: ibmi.c:71
int active_threads_in_system
Definition: ibmi.c:92
int percent_uncapped_cpu_capacity_used
Definition: ibmi.c:99
int percent_permanent_4gb_segments_used
Definition: ibmi.c:97
Definition: buffer.h:15
int bytes_provided
Definition: ibmi.c:112
int bytes_available
Definition: ibmi.c:113
Definition: z80asm.h:102
struct uv_cpu_times_s cpu_times
Definition: uv.h:1093
char * model
Definition: uv.h:1091
int speed
Definition: uv.h:1092
uint64_t nice
Definition: uv.h:1084
uint64_t sys
Definition: uv.h:1085
uint64_t idle
Definition: uv.h:1086
uint64_t user
Definition: uv.h:1083
uint64_t irq
Definition: uv.h:1087
struct sockaddr_in6 netmask6
Definition: uv.h:1106
struct sockaddr_in6 address6
Definition: uv.h:1102
struct sockaddr_in netmask4
Definition: uv.h:1105
union uv_interface_address_s::@399 netmask
union uv_interface_address_s::@398 address
struct sockaddr_in address4
Definition: uv.h:1101
char phys_addr[6]
Definition: uv.h:1098
int uv__search_path(const char *prog, char *buf, size_t *buflen)
Definition: core.c:1540
#define UV__PATH_MAX
Definition: internal.h:68
pthread_mutex_t uv_mutex_t
Definition: unix.h:137
pthread_once_t uv_once_t
Definition: unix.h:135
#define UV_ONCE_INIT
Definition: unix.h:133
char * uv__strdup(const char *s)
Definition: uv-common.c:55
void * uv__malloc(size_t size)
Definition: uv-common.c:75
void * uv__calloc(size_t count, size_t size)
Definition: uv-common.c:92
void uv__free(void *ptr)
Definition: uv-common.c:81
UV_EXTERN void uv_mutex_lock(uv_mutex_t *handle)
Definition: thread.c:330
UV_EXTERN void uv_once(uv_once_t *guard, void(*callback)(void))
Definition: thread.c:419
UV_EXTERN void uv_mutex_unlock(uv_mutex_t *handle)
Definition: thread.c:350
UV_EXTERN int uv_mutex_init(uv_mutex_t *handle)
Definition: thread.c:282