OSDN Git Service

(split) LDP man-pages の original/ を v3.29 に更新。
[linuxjm/LDP_man-pages.git] / original / man3 / gnu_get_libc_version.3
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 2010-09-10 "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 .BR "#define _GNU_SOURCE" "             /* See feature_test_macros(7) */"
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 .RB "$" " ./a.out"
56 GNU libc version: 2.8
57 GNU libc release: stable
58 .fi
59 .in
60 .SS Program source
61 \&
62 .nf
63 #include <gnu/libc-version.h>
64 #include <stdlib.h>
65 #include <stdio.h>
66
67 int
68 main(int argc, char *argv[])
69 {
70     printf("GNU libc version: %s\\n", gnu_get_libc_version());
71     printf("GNU libc release: %s\\n", gnu_get_libc_release());
72     exit(EXIT_SUCCESS);
73 }
74 .fi
75 .SH SEE ALSO
76 .BR confstr (3)