]>
Commit | Line | Data |
---|---|---|
6f9799dc MK |
1 | .\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk |
2 | .\" <mtk.manpages@gmail.com> | |
3 | .\" | |
5fbde956 | 4 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
6f9799dc | 5 | .\" |
4c1c5274 | 6 | .TH gnu_get_libc_version 3 (date) "Linux man-pages (unreleased)" |
6f9799dc MK |
7 | .SH NAME |
8 | gnu_get_libc_version, gnu_get_libc_release \- get glibc version and release | |
4508f8a0 AC |
9 | .SH LIBRARY |
10 | Standard C library | |
8fc3b2cf | 11 | .RI ( libc ", " \-lc ) |
6f9799dc MK |
12 | .SH SYNOPSIS |
13 | .nf | |
28a4c58c | 14 | .B #include <gnu/libc\-version.h> |
dbfe9c70 | 15 | .PP |
6f9799dc MK |
16 | .B const char *gnu_get_libc_version(void); |
17 | .B const char *gnu_get_libc_release(void); | |
18 | .fi | |
19 | .SH DESCRIPTION | |
20 | The function | |
21 | .BR gnu_get_libc_version () | |
22 | returns a string that identifies the glibc version available on the system. | |
847e0d88 | 23 | .PP |
6f9799dc MK |
24 | The function |
25 | .BR gnu_get_libc_release () | |
26 | returns a string indicates the release status of the glibc version | |
27 | available on the system. | |
28 | This will be a string such as | |
29 | .IR "stable" . | |
30 | .SH VERSIONS | |
31 | These functions first appeared in glibc in version 2.1. | |
2bee9c14 PH |
32 | .SH ATTRIBUTES |
33 | For an explanation of the terms used in this section, see | |
34 | .BR attributes (7). | |
c466875e MK |
35 | .ad l |
36 | .nh | |
2bee9c14 PH |
37 | .TS |
38 | allbox; | |
c466875e | 39 | lbx lb lb |
2bee9c14 PH |
40 | l l l. |
41 | Interface Attribute Value | |
42 | T{ | |
43 | .BR gnu_get_libc_version (), | |
44 | .BR gnu_get_libc_release () | |
45 | T} Thread safety MT-Safe | |
46 | .TE | |
c466875e MK |
47 | .hy |
48 | .ad | |
49 | .sp 1 | |
3113c7f3 | 50 | .SH STANDARDS |
6f9799dc | 51 | These functions are glibc-specific. |
a14af333 | 52 | .SH EXAMPLES |
6f9799dc | 53 | When run, the program below will produce output such as the following: |
e646a1ba | 54 | .PP |
6f9799dc | 55 | .in +4n |
e646a1ba | 56 | .EX |
b43a3b30 | 57 | .RB "$" " ./a.out" |
6f9799dc MK |
58 | GNU libc version: 2.8 |
59 | GNU libc release: stable | |
b8302363 | 60 | .EE |
6f9799dc | 61 | .in |
9c330504 | 62 | .SS Program source |
d84d0300 | 63 | \& |
b0b6ab4e | 64 | .\" SRC BEGIN (gnu_get_libc_version.c) |
e7d0bb47 | 65 | .EX |
6f9799dc | 66 | #include <stdio.h> |
ad3868f0 AC |
67 | #include <stdlib.h> |
68 | ||
69 | #include <gnu/libc\-version.h> | |
6f9799dc MK |
70 | |
71 | int | |
f1e39c1e | 72 | main(void) |
6f9799dc | 73 | { |
d1a71985 MK |
74 | printf("GNU libc version: %s\en", gnu_get_libc_version()); |
75 | printf("GNU libc release: %s\en", gnu_get_libc_release()); | |
6f9799dc MK |
76 | exit(EXIT_SUCCESS); |
77 | } | |
e7d0bb47 | 78 | .EE |
b0b6ab4e | 79 | .\" SRC END |
6f9799dc MK |
80 | .SH SEE ALSO |
81 | .BR confstr (3) |