gnu_get_libc_version(3)

✨ gnu_get_libc_version(3) ✨

okay bestie, you're in section 3 of the manual β€” that's the Library Functions Manual zone β€” and today we're getting to know gnu_get_libc_version and gnu_get_libc_release. yes, they're giving "who even are you" but honestly they're so useful. let's go πŸ’…


🌸 NAME 🌸

gnu_get_libc_version, gnu_get_libc_release β€” get glibc version and release


πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc)


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnu/libc-version.h>

const char *gnu_get_libc_version(void);
const char *gnu_get_libc_release(void);

πŸ’– DESCRIPTION πŸ’–

so here's the tea, bestie. gnu_get_libc_version() hands you back a string that identifies the glibc version available on the system. that's it. that's the whole vibe. a little string, a lot of power ✨

and then gnu_get_libc_release() returns a string indicating the release status of the glibc version available on the system. like, it'll be a string such as stable. iconic behavior honestly 🌈


πŸŽ€ ATTRIBUTES πŸŽ€

if you're confused about any of the words used in this section (fair, it's a whole thing), go peek at attributes(7). here's the rundown for our two little stars:

  • Interface: gnu_get_libc_version(), gnu_get_libc_release()
    • Attribute: Thread safety
    • Value: MT-Safe

translation? both of them are MT-Safe, so go ahead and call them from multiple threads, no cap πŸ‘‘


⭐ STANDARDS ⭐

GNU.

yep, that's the whole standard. it's GNU's thing, it lives in GNU land 🫢


🧚 HISTORY 🧚

glibc 2.1. ancient in a cute way, like a vintage handbag but for your libc.


πŸ”₯ EXAMPLES πŸ”₯

when you run the program below, it'll produce output such as the following:

$ ./a.out
GNU libc version: 2.8
GNU libc release: stable

(no, your version probably isn't 2.8, this is just the example being cute about it πŸ’€)

πŸ’œ Program source πŸ’œ

#include <stdio.h>
#include <stdlib.h>

#include <gnu/libc-version.h>

int
main(void)
{
    printf("GNU libc version: %s\n", gnu_get_libc_version());
    printf("GNU libc release: %s\n", gnu_get_libc_release());
    exit(EXIT_SUCCESS);
}

look at her. tiny main, two printfs, exit(EXIT_SUCCESS) at the end because we're polite. slay 🌸


πŸ‘€ SEE ALSO πŸ‘€


lowkey the whole page is short but that's because these functions are simple and that's their whole charm, bestie. two functions, two strings, zero drama. periodt πŸ’–

and that's a wrap!! this lil page came from Linux man-pages 6.20, dated 2025-09-06, filed under gnu_get_libc_version(3) β€” go forth and check your glibc version like the main character you are πŸŽ€πŸ’…βœ¨

πŸ“¦ 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: Linux-man-pages-copyleft
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms