]> git.ipfire.org Git - thirdparty/glibc.git/blame - csu/version.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / csu / version.c
CommitLineData
04277e02 1/* Copyright (C) 1992-2019 Free Software Foundation, Inc.
df4ef2ab 2 This file is part of the GNU C Library.
28f540f4 3
df4ef2ab 4 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
28f540f4 8
df4ef2ab
UD
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 12 Lesser General Public License for more details.
28f540f4 13
41bdb6e2 14 You should have received a copy of the GNU Lesser General Public
59ba27a6 15 License along with the GNU C Library; if not, see
5a82c748 16 <https://www.gnu.org/licenses/>. */
28f540f4 17
ce563359 18#include "version.h"
013aafb7 19#include <tls.h>
92ad15a8 20#include <libc-abis.h>
dc30f461
UD
21#include <gnu/libc-version.h>
22
23static const char __libc_release[] = RELEASE;
24static const char __libc_version[] = VERSION;
28f540f4 25
f332db02 26static const char banner[] =
bedbd859 27"GNU C Library "PKGVERSION RELEASE" release version "VERSION".\n\
c9123888 28Copyright (C) 2019 Free Software Foundation, Inc.\n\
28f540f4
RM
29This is free software; see the source for copying conditions.\n\
30There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
41df5ed4
RH
31PARTICULAR PURPOSE.\n\
32Compiled by GNU CC version "__VERSION__".\n"
92ad15a8
UD
33#ifdef LIBC_ABIS_STRING
34LIBC_ABIS_STRING
35#endif
d40eb37a 36"For bug reporting instructions, please see:\n\
8b748aed 37"REPORT_BUGS_TO".\n";
f332db02
RM
38
39#include <unistd.h>
40
2f8a05d8 41extern void __libc_print_version (void) attribute_hidden;
f332db02
RM
42void
43__libc_print_version (void)
44{
45 __write (STDOUT_FILENO, banner, sizeof banner - 1);
28f540f4 46}
463e148b 47
844b79a6 48extern const char *__gnu_get_libc_release (void);
dc30f461
UD
49const char *
50__gnu_get_libc_release (void)
51{
52 return __libc_release;
53}
54weak_alias (__gnu_get_libc_release, gnu_get_libc_release)
55
844b79a6 56extern const char *__gnu_get_libc_version (void);
dc30f461
UD
57const char *
58__gnu_get_libc_version (void)
59{
60 return __libc_version;
61}
62weak_alias (__gnu_get_libc_version, gnu_get_libc_version)
63
463e148b
RM
64/* This function is the entry point for the shared object.
65 Running the library as a program will get here. */
66
17427edd 67extern void __libc_main (void) __attribute__ ((noreturn));
463e148b
RM
68void
69__libc_main (void)
70{
71 __libc_print_version ();
f332db02 72 _exit (0);
463e148b 73}