KDK_REAL_GET_DISK_RATE(3)

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

💖 KDK_REAL_GET_DISK_RATE(3) 💖

okay bestie, so this one is a page from the Library Functions Manual and it's literally just about asking your disk "hey how fast are you spinning rn" 🌀 no cap. It's giving tiny-function-big-energy.


✨ NAME ✨

kdk_real_get_disk_rate — 获取磁盘转速 🌸

(yes the description is in Chinese, and yes it means "get the disk rotational speed" — we love a multilingual icon 💅)


🎀 SYNOPSIS 🎀

#include <libkyrealtimeinfo.h>

extern int kdk_real_get_disk_rate(const char *name);

and bestie, do NOT forget to link with -lkyrealtime or the linker will simply not know her 🫶


🦋 Detailed Description 🦋

So the whole main character job of this interface? It gets you the disk rotational speed. That's it, that's the function, and honestly? Obsessed. 😌

The argument name is the name of the disk — and when they say name they mean an absolute path situation, like /dev/sda. Give her the path, she gives you the spin. ✨


💀 RETURN VALUE 💀

  • On success — you get the disk rotational speed back, and it's of type int. Slay. 🎉
  • On error — you get -1. Sad girl hours, check your path bestie. 😭

🌈 EXAMPLES 🌈

here's the vibe, copied exactly, no notes:

#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;
}

(yes, the quotes and the 0s in there are Exactly As Written. Not me fixing them. Not me touching them. That's the source, and we respect her journey. 🙈)


👑 CONFORMING TO 👑

These functions are as per the withdrawn POSIX.1e draft specification. Yeah. Withdrawn. She's a legacy queen, an icon from a draft that never fully made it, and we still love her. 💜

The following functions are Linux extensions:

  • kdk_real_get_net_speed()
  • kdk_real_get_cpu_temperature()
  • kdk_real_get_disk_temperature()
  • kdk_real_get_if_speed()

🔥 SEE ALSO 🔥


and that's the whole page bestie, go forth and read your disk's rpm 💖

this one came from the Linux Programmer's Manual, dated Tue Sep 19 2023, and her name up in the corner is KDK_REAL_GET_DISK_RATE(3). periodt. 💅✨

📦 where this page comes from