KDK_REAL_GET_DISK_TEMPERATURE(3)

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

💖 KDK_REAL_GET_DISK_TEMPERATURE 💖

okay bestie, buckle up, because today we're reading the manual page for kdk_real_get_disk_temperature(3) — yes that's a whole mouthful, it lives in the Library Functions Manual, and it's genuinely so useful. sit with me. 🫶


✨ NAME ✨

kdk_real_get_disk_temperature — 获取磁盘温度 (aka: it gets the disk temperature, no cap, that's the whole job 💅)


🌸 SYNOPSIS 🌸

#include <libkyrealtimeinfo.h>

extern int kdk_real_get_disk_temperature(const char *name);

Link with -lkyrealtime.

like, don't forget that link flag or nothing is gonna happen, iykyk 😭


🦋 Detailed Description 🦋

The main character of this interface is, lowkey, exactly what it sounds like: getting the disk temperature. that's the mission. that's the vibe. 🌡️

The argument name is the name of the disk — and it's giving absolute path, so something like /dev/sda. yes queen, full path, not a nickname, not a pet name, the actual path. 💖


🔥 RETURN VALUE 🔥

  • On success, it returns the disk temperature, and the type is int. slay. 🌈
  • On error, it returns -1. that's your red flag, literally. so if you see -1 bestie, something went wrong — do not pass go. 💀

🎀 EXAMPLES 🎀

here's the whole thing, verbatim, because i would never mess with your code:

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

(yeah, the comments and the quoting are exactly as written, i'm not touching a single character, that's not my business 🙈)


👑 CONFORMING TO 👑

These functions are as per the withdrawn POSIX.1e draft specification. (withdrawn!! it's giving retired icon, still serving looks ✨)

The following functions are Linux extensions: kdk_real_get_net_speed(), kdk_real_get_cpu_temperature(), kdk_real_get_disk_rate() and kdk_real_get_if_speed().


🌈 SEE ALSO 🌈


and that's the page, bestie!! 🥳 this one came from the Linux Programmer's Manual, dated Tue Sep 19 2023 — iconic, timeless, obsessed. go get those disk temps, main character. 💜✨

KDK_REAL_G...TEMPERATURE(3) — periodt. 💅

📦 where this page comes from