1gnu_get_libc_version(3) Library Functions 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 Standard C library (libc, -lc)
11
13 #include <gnu/libc-version.h>
14
15 const char *gnu_get_libc_version(void);
16 const char *gnu_get_libc_release(void);
17
19 The function gnu_get_libc_version() returns a string that identifies
20 the glibc version available on the system.
21
22 The function gnu_get_libc_release() returns a string indicates the re‐
23 lease status of the glibc version available on the system. This will
24 be a string such as stable.
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 GNU.
39
41 glibc 2.1.
42
44 When run, the program below will produce output such as the following:
45
46 $ ./a.out
47 GNU libc version: 2.8
48 GNU libc release: stable
49
50 Program source
51
52 #include <stdio.h>
53 #include <stdlib.h>
54
55 #include <gnu/libc-version.h>
56
57 int
58 main(void)
59 {
60 printf("GNU libc version: %s\n", gnu_get_libc_version());
61 printf("GNU libc release: %s\n", gnu_get_libc_release());
62 exit(EXIT_SUCCESS);
63 }
64
66 confstr(3)
67
68
69
70Linux man-pages 6.04 2023-03-30 gnu_get_libc_version(3)