getloadavg(3)

✨ getloadavg(3) ✨

okay bestie, welcome to the getloadavg page πŸ’– this one lives in section 3 of the manual, and it's literally just "hey, how stressed is my computer rn" in function form. no cap.


🌸 NAME 🌸

getloadavg β€” get system load averages πŸ’…


πŸŽ€ LIBRARY πŸŽ€

Standard C library (libc, -lc)


✨ SYNOPSIS ✨

#include <stdlib.h>

int getloadavg(double loadavg[], int n);

πŸ¦‹ Feature Test Macro Requirements for glibc (see feature_test_macros(7)):

  • getloadavg():
    • Since glibc 2.19:
      • _DEFAULT_SOURCE
    • In glibc up to and including 2.19:
      • _BSD_SOURCE

πŸ’œ DESCRIPTION πŸ’œ

so basically, getloadavg() tells you how many processes are chilling in the system run queue, averaged over various periods of time. like, it's the vibe check for your CPU's to-do list πŸ“‹

Up to n samples get retrieved and assigned to successive elements of loadavg[]. and here's the tea: the system imposes a maximum of 3 samples, representing averages over the last 1, 5, and 15 minutes, respectively. so that's it, that's the whole menu πŸ“


πŸ‘‘ RETURN VALUE πŸ‘‘

if the load average was unobtainable, -1 is returned 😭 otherwise, you get back the number of samples actually retrieved. so like, count your blessings, literally.


πŸ’€ ATTRIBUTES πŸ’€

for an explanation of the terms used in this section, see attributes(7).

  • Interface: getloadavg()
  • Attribute: Thread safety
  • Value: MT-Safe

🌈 STANDARDS 🌈

BSD. periodt.


🧚 HISTORY 🧚

4.3BSD-Reno, Solaris. glibc 2.2. she's been around, bestie, she's a legend πŸ‘‘


🫢 SEE ALSO 🫢

uptime(1), proc(5)


and that's the page!! this one's from the Linux man-pages 6.20 era, dated 2025-09-21 πŸ’– go forth and check your load average, you icon, you. slay ✨

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: BSD-3-Clause
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms