]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/gnu_get_libc_version.3
man-pages.7: spfix
[thirdparty/man-pages.git] / man3 / gnu_get_libc_version.3
CommitLineData
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
26gnu_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
36The function
37.BR gnu_get_libc_version ()
38returns a string that identifies the glibc version available on the system.
39
40The function
41.BR gnu_get_libc_release ()
42returns a string indicates the release status of the glibc version
43available on the system.
44This will be a string such as
45.IR "stable" .
46.SH VERSIONS
47These functions first appeared in glibc in version 2.1.
48.SH CONFORMING TO
49These functions are glibc-specific.
50.SH EXAMPLE
51When run, the program below will produce output such as the following:
52.in +4n
53.nf
54
55$ ./a.out
56GNU libc version: 2.8
57GNU 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
66int
67main(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)