KDK_REAL_GET_IF_SPEED(3)

📦 version 3.0.1.4, in arch rolling, ubuntu resolute, ubuntu stonking

💖 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, -1 is 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:


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