1GNU_GET_LIBC_VERSION(3) Linux Programmer's Manual GNU_GET_LIBC_VERSION(3)
2
3
4
6 gnu_get_libc_version, gnu_get_libc_release - get glibc version and re‐
7 lease
8
10 #include <gnu/libc-version.h>
11
12 const char *gnu_get_libc_version(void);
13 const char *gnu_get_libc_release(void);
14
16 The function gnu_get_libc_version() returns a string that identifies
17 the glibc version available on the system.
18
19 The function gnu_get_libc_release() returns a string indicates the re‐
20 lease status of the glibc version available on the system. This will
21 be a string such as stable.
22
24 These functions first appeared in glibc in version 2.1.
25
27 For an explanation of the terms used in this section, see at‐
28 tributes(7).
29
30 ┌────────────────────────────────────────────┬───────────────┬─────────┐
31 │Interface │ Attribute │ Value │
32 ├────────────────────────────────────────────┼───────────────┼─────────┤
33 │gnu_get_libc_version(), │ Thread safety │ MT-Safe │
34 │gnu_get_libc_release() │ │ │
35 └────────────────────────────────────────────┴───────────────┴─────────┘
36
38 These functions are glibc-specific.
39
41 When run, the program below will produce output such as the following:
42
43 $ ./a.out
44 GNU libc version: 2.8
45 GNU libc release: stable
46
47 Program source
48
49 #include <gnu/libc-version.h>
50 #include <stdlib.h>
51 #include <stdio.h>
52
53 int
54 main(int argc, char *argv[])
55 {
56 printf("GNU libc version: %s\n", gnu_get_libc_version());
57 printf("GNU libc release: %s\n", gnu_get_libc_release());
58 exit(EXIT_SUCCESS);
59 }
60
62 confstr(3)
63
65 This page is part of release 5.13 of the Linux man-pages project. A
66 description of the project, information about reporting bugs, and the
67 latest version of this page, can be found at
68 https://www.kernel.org/doc/man-pages/.
69
70
71
72Linux 2021-03-22 GNU_GET_LIBC_VERSION(3)