lsm_local...status_get(3)

πŸ“¦
version 1.10.3 Β· 3 versions
, in fedora 43, fedora 44

πŸ’– lsm_local_disk_led_status_get πŸ’–

okay bestie, welcome to the Libstoragemgmt C API Manual β€” yes this is a section 3 page, we're in library-call territory, and we're about to get your disk's LED situation fully figured out. no cap. ✨


🌸 NAME 🌸

lsm_local_disk_led_status_get β€” the girl whose whole job is querying disk LED status. that's it. that's the function. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

int lsm_local_disk_led_status_get (const char *disk_path, uint32_t
*led_status, lsm_error **lsm_err);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • disk_path β€” a String, bestie. it's the path of the disk, like for example "/dev/sdb". yeah, that kind of path. 🌈
  • led_status β€” output pointer of uint32_t. heads up: this is a bit sensitive field. not like emotionally sensitive (though honestly, same), we mean bit-sensitive. πŸ‘‘
  • lsm_err β€” output pointer of lsm_error. if something goes sideways, you can pull the error message out with lsm_error_message_get, and when you're done with it you gotta free that memory with lsm_error_free. don't leave it hanging, it's giving rude. πŸ’€

⭐ VERSION ⭐

1.4 β€” periodt.


✨ DESCRIPTION ✨

So what does this actually do? It queries the disk LED status of the disk path you specified. simple, iconic, main character energy. 🫢

lowkey important: you need permission to open that specified disk path β€” think root user or the disk group. if you don't have it, that's a whole vibe check you're gonna fail.

and now, the moment you've been waiting for β€” the led_status output is a bit sensitive field, and here's every bit it can be:

  • LSM_DISK_LED_STATUS_UNKNOWN
  • LSM_DISK_LED_STATUS_IDENT_ON
  • LSM_DISK_LED_STATUS_IDENT_OFF
  • LSM_DISK_LED_STATUS_IDENT_UNKNOWN
  • LSM_DISK_LED_STATUS_FAULT_ON
  • LSM_DISK_LED_STATUS_FAULT_OFF
  • LSM_DISK_LED_STATUS_FAULT_UNKNOWN

that's the whole list, no crumbs left behind. πŸ’–


πŸ”₯ RETURN πŸ”₯

The return value is an error code, enumerated by 'lsm_error_number'. here's every single one, and yes, we're doing all of them:

  • LSM_ERR_OK
    • On success. slay. ✨
  • LSM_ERR_INVALID_ARGUMENT
    • When any argument is NULL. bestie, don't do that.
  • LSM_ERR_LIB_BUG
    • When something unexpected happens. 😭
  • LSM_ERR_NOT_FOUND_DISK
    • When provided disk path not found. it's just… not there.
  • LSM_ERR_PERMISSION_DENIED
    • Insufficient permission to access provided disk path. we talked about this. πŸ™ˆ
  • LSM_ERR_NO_SUPPORT
    • Action is not supported. not every disk wants to be perceived, and that's valid.

and that's the whole page, bestie!! go forth and query those LEDs responsibly. 🧚

signing off from the February 2026 edition of lsm_local_disk_led_status_get, aka lsm_local...status_get(3) β€” mwah, love u, bye!! πŸ’…πŸŽ€

πŸ“¦ where this page comes from