Back to index

glibc  2.9
version.c
Go to the documentation of this file.
00001 /* Copyright (C) 1992-2006, 2007, 2008 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #include "version.h"
00020 #include <tls.h>
00021 #include <gnu/libc-version.h>
00022 
00023 static const char __libc_release[] = RELEASE;
00024 static const char __libc_version[] = VERSION;
00025 
00026 static const char banner[] =
00027 "GNU C Library "RELEASE" release version "VERSION", by Roland McGrath et al.\n\
00028 Copyright (C) 2008 Free Software Foundation, Inc.\n\
00029 This is free software; see the source for copying conditions.\n\
00030 There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
00031 PARTICULAR PURPOSE.\n\
00032 Compiled by GNU CC version "__VERSION__".\n"
00033 #include "version-info.h"
00034 #ifdef GLIBC_OLDEST_ABI
00035 "The oldest ABI supported: " GLIBC_OLDEST_ABI ".\n"
00036 #endif
00037 "For bug reporting instructions, please see:\n\
00038 <http://www.gnu.org/software/libc/bugs.html>.\n";
00039 
00040 #include <unistd.h>
00041 
00042 extern void __libc_print_version (void);
00043 void
00044 __libc_print_version (void)
00045 {
00046   __write (STDOUT_FILENO, banner, sizeof banner - 1);
00047 }
00048 
00049 extern const char *__gnu_get_libc_release (void);
00050 const char *
00051 __gnu_get_libc_release (void)
00052 {
00053   return __libc_release;
00054 }
00055 weak_alias (__gnu_get_libc_release, gnu_get_libc_release)
00056 
00057 extern const char *__gnu_get_libc_version (void);
00058 const char *
00059 __gnu_get_libc_version (void)
00060 {
00061   return __libc_version;
00062 }
00063 weak_alias (__gnu_get_libc_version, gnu_get_libc_version)
00064 
00065 #ifdef HAVE_ELF
00066 /* This function is the entry point for the shared object.
00067    Running the library as a program will get here.  */
00068 
00069 extern void __libc_main (void) __attribute__ ((noreturn));
00070 void
00071 __libc_main (void)
00072 {
00073   __libc_print_version ();
00074   _exit (0);
00075 }
00076 #endif