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