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