KDK_REAL_GET_IF_SPEED(3)
💖 KDK_REAL_GET_IF_SPEED(3) 💖
okay so bestie, welcome to the Library Functions Manual ✨ this one's called kdk_real_get_if_speed and it's literally about 获取下载的瞬时网速信息 — yep, that's "grab the instantaneous download network speed" in Chinese, and no I'm not translating it away because it's the actual NAME line, we keep the receipts 🧾💅
✨ NAME ✨
kdk_real_get_if_speed — 获取下载的瞬时网速信息 (a.k.a. get the instant download net speed, fr fr) 🦋
🌸 SYNOPSIS 🌸
#include <libkyrealtimeinfo.h>
extern float kdk_real_get_if_speed(const char *nc);
and like, don't forget to link it, okay?
-lkyrealtime
Link with -lkyrealtime. If you skip this the linker will simply not know her and that's embarrassing for everyone 😭
🎀 Detailed Description 🎀
The main character job of this interface? Getting you the instantaneous network speed information for download. That's it. That's the whole vibe. 🔥
The argument nc is the name of the NIC — think "eno1" energy. Network Interface Card name, bestie, the actual hardware's name, not a nickname you made up 🫶
👑 RETURN VALUE 👑
- On success, returns the instantaneous network speed of download, with type
float. slay ✨ - On error, return
-1. and like,-1is never a real speed, so if you see it, something went wrong, no cap 💀
🌈 EXAMPLES 🌈
here's the whole thing, copied exactly, don't @ me:
#include "stdio.h"
#include "libkyrealtimeinfo.h"
int main()
{
// if(argc < 3)
// {
// printf("./kyrealtime-test <网卡名> <磁盘名>0);
// return 0;
// }
printf("netSpeed : %f0, kdk_real_get_net_speed("enaftgm1i0"));
printf("cpuTemp: %f0, kdk_real_get_cpu_temperature());
printf("diskTemp : %d0, kdk_real_get_disk_temperature("/dev/nvme0n1"));
printf("diskRate : %d0, kdk_real_get_disk_rate("/dev/nvme0n1"));
printf("ifnetSpeed : %f0, kdk_real_get_if_speed("enaftgm1i0"));
return 0;
}
💜 CONFORMING TO 💜
These functions are as per the withdrawn POSIX.1e draft specification. yeah, withdrawn, iconic behaviour honestly 🙈
The following functions are Linux extensions, periodt:
kdk_real_get_net_speed()kdk_real_get_cpu_temperature()kdk_real_get_disk_temperature()kdk_real_get_disk_rate()
🦋 SEE ALSO 🦋
go read her sisters, they're all eating:
kdk_real_get_net_speed(3)kdk_real_get_cpu_temperature(3)kdk_real_get_disk_temperature(3)kdk_real_get_disk_rate(3)
lowkey important: that POSIX.1e spec is withdrawn, so don't go telling people this is standard standard, iykyk 🌸
mwah, that's the whole page 💖 this came from the Linux Programmer's Manual, dated Tue Sep 19 2023, and it's the KDK_REAL_GET_IF_SPEED(3) page specifically — go get that net speed bestie, you got this 🎀✨💅
📦 where this page comes from
- arch rolling: libkysdk-system 3.0.1.4-1 · LGPL-3.0-or-later AND LGPL-2.1-only OR LGPL-3.0-only AND LGPL-2.1-only WITH Qt-LGPL-exception-1.1 OR LGPL-3.0-only WITH Qt-LGPL-exception-1.1 AND MIT
- ubuntu resolute: libkysdk-system-dev 3.0.1.2-0ubuntu1 · LGPL-3.0-only
- ubuntu stonking: libkysdk-system-dev 3.0.1.3-0ubuntu1 · LGPL-3.0-or-later
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms