Lines Matching refs:buf
415 ssize_t uv__getrandom(void* buf, size_t buflen, unsigned flags) { in uv__getrandom() argument
421 rc = syscall(__NR_getrandom, buf, buflen, flags); in uv__getrandom()
423 uv__msan_unpoison(buf, buflen); in uv__getrandom()
1122 void uv__statx_to_stat(const struct uv__statx* statxbuf, uv_stat_t* buf) { in uv__statx_to_stat() argument
1123 buf->st_dev = makedev(statxbuf->stx_dev_major, statxbuf->stx_dev_minor); in uv__statx_to_stat()
1124 buf->st_mode = statxbuf->stx_mode; in uv__statx_to_stat()
1125 buf->st_nlink = statxbuf->stx_nlink; in uv__statx_to_stat()
1126 buf->st_uid = statxbuf->stx_uid; in uv__statx_to_stat()
1127 buf->st_gid = statxbuf->stx_gid; in uv__statx_to_stat()
1128 buf->st_rdev = makedev(statxbuf->stx_rdev_major, statxbuf->stx_rdev_minor); in uv__statx_to_stat()
1129 buf->st_ino = statxbuf->stx_ino; in uv__statx_to_stat()
1130 buf->st_size = statxbuf->stx_size; in uv__statx_to_stat()
1131 buf->st_blksize = statxbuf->stx_blksize; in uv__statx_to_stat()
1132 buf->st_blocks = statxbuf->stx_blocks; in uv__statx_to_stat()
1133 buf->st_atim.tv_sec = statxbuf->stx_atime.tv_sec; in uv__statx_to_stat()
1134 buf->st_atim.tv_nsec = statxbuf->stx_atime.tv_nsec; in uv__statx_to_stat()
1135 buf->st_mtim.tv_sec = statxbuf->stx_mtime.tv_sec; in uv__statx_to_stat()
1136 buf->st_mtim.tv_nsec = statxbuf->stx_mtime.tv_nsec; in uv__statx_to_stat()
1137 buf->st_ctim.tv_sec = statxbuf->stx_ctime.tv_sec; in uv__statx_to_stat()
1138 buf->st_ctim.tv_nsec = statxbuf->stx_ctime.tv_nsec; in uv__statx_to_stat()
1139 buf->st_birthtim.tv_sec = statxbuf->stx_btime.tv_sec; in uv__statx_to_stat()
1140 buf->st_birthtim.tv_nsec = statxbuf->stx_btime.tv_nsec; in uv__statx_to_stat()
1141 buf->st_flags = 0; in uv__statx_to_stat()
1142 buf->st_gen = 0; in uv__statx_to_stat()
1148 uv_stat_t* buf; in uv__iou_fs_statx_post() local
1150 buf = &req->statbuf; in uv__iou_fs_statx_post()
1156 uv__statx_to_stat(statxbuf, buf); in uv__iou_fs_statx_post()
1157 req->ptr = buf; in uv__iou_fs_statx_post()
1659 char buf[1024]; in uv_resident_set_memory() local
1666 rc = uv__slurp("/proc/self/stat", buf, sizeof(buf)); in uv_resident_set_memory()
1671 s = strrchr(buf, ')'); in uv_resident_set_memory()
1695 char buf[128]; in uv_uptime() local
1701 if (0 == uv__slurp("/proc/uptime", buf, sizeof(buf))) in uv_uptime()
1702 if (1 == sscanf(buf, "%lf", uptime)) in uv_uptime()
1771 char buf[1024]; in uv_cpu_info() local
1788 if (NULL == fgets(buf, sizeof(buf), fp)) in uv_cpu_info()
1800 if (NULL == fgets(buf, sizeof(buf), fp)) in uv_cpu_info()
1825 while (!found && fgets(buf, sizeof(buf), fp)) in uv_cpu_info()
1826 found = !strncmp(buf, model_marker, sizeof(model_marker) - 1); in uv_cpu_info()
1831 p = buf + sizeof(model_marker) - 1; in uv_cpu_info()
1858 while (fgets(buf, sizeof(buf), fp)) in uv_cpu_info()
1859 if (*buf == '\n') in uv_cpu_info()
1874 snprintf(buf, sizeof(buf), in uv_cpu_info()
1877 fp = uv__open_file(buf); in uv_cpu_info()
2046 char buf[4096]; /* Large enough to hold all of /proc/meminfo. */ in uv__read_proc_meminfo() local
2048 if (uv__slurp("/proc/meminfo", buf, sizeof(buf))) in uv__read_proc_meminfo()
2051 p = strstr(buf, what); in uv__read_proc_meminfo()
2098 char buf[32]; /* Large enough to hold an encoded uint64_t. */ in uv__read_uint64() local
2102 if (0 == uv__slurp(filename, buf, sizeof(buf))) in uv__read_uint64()
2103 if (1 != sscanf(buf, "%" PRIu64, &rc)) in uv__read_uint64()
2104 if (0 == strcmp(buf, "max\n")) in uv__read_uint64()
2115 static char* uv__cgroup1_find_memory_controller(char buf[static 1024], in uv__cgroup1_find_memory_controller()
2120 p = strchr(buf, ':'); in uv__cgroup1_find_memory_controller()
2136 static void uv__get_cgroup1_memory_limits(char buf[static 1024], uint64_t* high, in uv__get_cgroup1_memory_limits()
2144 p = uv__cgroup1_find_memory_controller(buf, &n); in uv__get_cgroup1_memory_limits()
2176 static void uv__get_cgroup2_memory_limits(char buf[static 1024], uint64_t* high, in uv__get_cgroup2_memory_limits()
2183 p = buf + strlen("0::/"); in uv__get_cgroup2_memory_limits()
2193 static uint64_t uv__get_cgroup_constrained_memory(char buf[static 1024]) { in uv__get_cgroup_constrained_memory()
2198 if (strncmp(buf, "0::/", 4)) in uv__get_cgroup_constrained_memory()
2199 uv__get_cgroup1_memory_limits(buf, &high, &max); in uv__get_cgroup_constrained_memory()
2201 uv__get_cgroup2_memory_limits(buf, &high, &max); in uv__get_cgroup_constrained_memory()
2210 char buf[1024]; in uv_get_constrained_memory() local
2212 if (uv__slurp("/proc/self/cgroup", buf, sizeof(buf))) in uv_get_constrained_memory()
2215 return uv__get_cgroup_constrained_memory(buf); in uv_get_constrained_memory()
2219 static uint64_t uv__get_cgroup1_current_memory(char buf[static 1024]) { in uv__get_cgroup1_current_memory()
2226 p = uv__cgroup1_find_memory_controller(buf, &n); in uv__get_cgroup1_current_memory()
2243 static uint64_t uv__get_cgroup2_current_memory(char buf[static 1024]) { in uv__get_cgroup2_current_memory()
2249 p = buf + strlen("0::/"); in uv__get_cgroup2_current_memory()
2258 char buf[1024]; in uv_get_available_memory() local
2263 if (uv__slurp("/proc/self/cgroup", buf, sizeof(buf))) in uv_get_available_memory()
2266 constrained = uv__get_cgroup_constrained_memory(buf); in uv_get_available_memory()
2275 if (strncmp(buf, "0::/", 4)) in uv_get_available_memory()
2276 current = uv__get_cgroup1_current_memory(buf); in uv_get_available_memory()
2278 current = uv__get_cgroup2_current_memory(buf); in uv_get_available_memory()
2291 char buf[1024]; in uv__get_cgroupv2_constrained_cpu() local
2309 if (uv__slurp(path, buf, sizeof(buf)) < 0) in uv__get_cgroupv2_constrained_cpu()
2312 if (sscanf(buf, "%15s %llu", quota_buf, &constraint->period_length) != 2) in uv__get_cgroupv2_constrained_cpu()
2325 if (uv__slurp(path, buf, sizeof(buf)) < 0) in uv__get_cgroupv2_constrained_cpu()
2328 if (sscanf(buf, "%u", &weight) != 1) in uv__get_cgroupv2_constrained_cpu()
2354 char buf[1024]; in uv__get_cgroupv1_constrained_cpu() local
2368 if (uv__slurp(path, buf, sizeof(buf)) < 0) in uv__get_cgroupv1_constrained_cpu()
2371 if (sscanf(buf, "%lld", &constraint->quota_per_period) != 1) in uv__get_cgroupv1_constrained_cpu()
2379 if (uv__slurp(path, buf, sizeof(buf)) < 0) in uv__get_cgroupv1_constrained_cpu()
2382 if (sscanf(buf, "%lld", &constraint->period_length) != 1) in uv__get_cgroupv1_constrained_cpu()
2390 if (uv__slurp(path, buf, sizeof(buf)) < 0) in uv__get_cgroupv1_constrained_cpu()
2393 if (sscanf(buf, "%u", &shares) != 1) in uv__get_cgroupv1_constrained_cpu()
2420 char buf[128]; /* Large enough to hold all of /proc/loadavg. */ in uv_loadavg() local
2422 if (0 == uv__slurp("/proc/loadavg", buf, sizeof(buf))) in uv_loadavg()
2423 if (3 == sscanf(buf, "%lf %lf %lf", &avg[0], &avg[1], &avg[2])) in uv_loadavg()
2557 char buf[4096]; in uv__inotify_read() local
2561 size = read(loop->inotify_fd, buf, sizeof(buf)); in uv__inotify_read()
2572 for (p = buf; p < buf + size; p += sizeof(*e) + e->len) { in uv__inotify_read()