]>
Commit | Line | Data |
---|---|---|
6f9799dc MK |
1 | .\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk |
2 | .\" <mtk.manpages@gmail.com> | |
3 | .\" | |
4 | .\" Permission is granted to make and distribute verbatim copies of this | |
5 | .\" manual provided the copyright notice and this permission notice are | |
6 | .\" preserved on all copies. | |
7 | .\" | |
8 | .\" Permission is granted to copy and distribute modified versions of this | |
9 | .\" manual under the conditions for verbatim copying, provided that the | |
10 | .\" entire resulting derived work is distributed under the terms of a | |
11 | .\" permission notice identical to this one. | |
12 | .\" | |
13 | .\" Since the Linux kernel and libraries are constantly changing, this | |
14 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
15 | .\" responsibility for errors or omissions, or for damages resulting from | |
16 | .\" the use of the information contained herein. The author(s) may not | |
17 | .\" have taken the same level of care in the production of this manual, | |
18 | .\" which is licensed free of charge, as they might when working | |
19 | .\" professionally. | |
20 | .\" | |
21 | .\" Formatted or processed versions of this manual, if unaccompanied by | |
22 | .\" the source, must acknowledge the copyright and authors of this work. | |
23 | .\" | |
24 | .TH GNU_GET_LIBC_VERSION 3 2008-07-02 "Linux" "Linux Programmer's Manual" | |
25 | .SH NAME | |
26 | gnu_get_libc_version, gnu_get_libc_release \- get glibc version and release | |
27 | .SH SYNOPSIS | |
28 | .nf | |
29 | .B #define _GNU_SOURCE | |
30 | .B #include <gnu/libc-version.h> | |
31 | ||
32 | .B const char *gnu_get_libc_version(void); | |
33 | .B const char *gnu_get_libc_release(void); | |
34 | .fi | |
35 | .SH DESCRIPTION | |
36 | The function | |
37 | .BR gnu_get_libc_version () | |
38 | returns a string that identifies the glibc version available on the system. | |
39 | ||
40 | The function | |
41 | .BR gnu_get_libc_release () | |
42 | returns a string indicates the release status of the glibc version | |
43 | available on the system. | |
44 | This will be a string such as | |
45 | .IR "stable" . | |
46 | .SH VERSIONS | |
47 | These functions first appeared in glibc in version 2.1. | |
48 | .SH CONFORMING TO | |
49 | These functions are glibc-specific. | |
50 | .SH EXAMPLE | |
51 | When run, the program below will produce output such as the following: | |
52 | .in +4n | |
53 | .nf | |
54 | ||
55 | $ ./a.out | |
56 | GNU libc version: 2.8 | |
57 | GNU libc release: stable | |
58 | ||
59 | .fi | |
60 | .in | |
61 | .nf | |
62 | #include <gnu/libc-version.h> | |
63 | #include <stdlib.h> | |
64 | #include <stdio.h> | |
65 | ||
66 | int | |
67 | main(int argc, char *argv[]) | |
68 | { | |
69 | printf("GNU libc version: %s\\n", gnu_get_libc_version()); | |
70 | printf("GNU libc release: %s\\n", gnu_get_libc_release()); | |
71 | exit(EXIT_SUCCESS); | |
72 | } | |
73 | .fi | |
74 | .SH SEE ALSO | |
75 | .BR confstr (3) |