Debian Codegraph @

upstream/debian-trixie/man3/gnu_get_libc_version.3

raw
1 '\" t
2 .\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <[email protected]>
4 .\"
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\"
7 .TH gnu_get_libc_version 3 2024-06-15 "Linux man-pages 6.9.1"
8 .SH NAME
9 gnu_get_libc_version, gnu_get_libc_release \- get glibc version and release
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc ", " \-lc )
13 .SH SYNOPSIS
14 .nf
15 .B #include <gnu/libc\-version.h>
16 .P
17 .B const char *gnu_get_libc_version(void);
18 .B const char *gnu_get_libc_release(void);
19 .fi
20 .SH DESCRIPTION
21 The function
22 .BR gnu_get_libc_version ()
23 returns a string that identifies the glibc version available on the system.
24 .P
25 The function
26 .BR gnu_get_libc_release ()
27 returns a string indicates the release status of the glibc version
28 available on the system.
29 This will be a string such as
30 .IR "stable" .
31 .SH ATTRIBUTES
32 For an explanation of the terms used in this section, see
33 .BR attributes (7).
34 .TS
35 allbox;
36 lbx lb lb
37 l l l.
38 Interface Attribute Value
39 T{
40 .na
41 .nh
42 .BR gnu_get_libc_version (),
43 .BR gnu_get_libc_release ()
44 T} Thread safety MT-Safe
45 .TE
46 .SH STANDARDS
47 GNU.
48 .SH HISTORY
49 glibc 2.1.
50 .SH EXAMPLES
51 When run, the program below will produce output such as the following:
52 .P
53 .in +4n
54 .EX
55 .RB "$" " ./a.out"
56 GNU libc version: 2.8
57 GNU libc release: stable
58 .EE
59 .in
60 .SS Program source
61 \&
62 .\" SRC BEGIN (gnu_get_libc_version.c)
63 .EX
64 #include <stdio.h>
65 #include <stdlib.h>
66 \&
67 #include <gnu/libc\-version.h>
68 \&
69 int
70 main(void)
71 {
72 printf("GNU libc version: %s\[rs]n", gnu_get_libc_version());
73 printf("GNU libc release: %s\[rs]n", gnu_get_libc_release());
74 exit(EXIT_SUCCESS);
75 }
76 .EE
77 .\" SRC END
78 .SH SEE ALSO
79 .BR confstr (3)