version.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* Copyright (C) 1992-2018 Free Software Foundation, Inc.
  2. The GNU C Library is free software; you can redistribute it and/or
  3. modify it under the terms of the GNU Lesser General Public
  4. License as published by the Free Software Foundation; either
  5. version 2.1 of the License, or (at your option) any later version.
  6. The GNU C Library is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  9. Lesser General Public License for more details.
  10. You should have received a copy of the GNU Lesser General Public
  11. License along with the GNU C Library; if not, see
  12. <http://www.gnu.org/licenses/>. */
  13. #include "version.h"
  14. #include <gnu/libc-version.h>
  15. static const char __libc_release[] = RELEASE;
  16. static const char __libc_version[] = VERSION;
  17. static const char banner[] =
  18. "uClibc-ng "RELEASE" release version "VERSION".\n\
  19. Copyright (C) 2018 Waldemar Brodkorb <wbx@uclibc-ng.org>\n\
  20. This is free software; see the source for copying conditions.\n\
  21. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
  22. PARTICULAR PURPOSE.\n\
  23. Compiled by GNU CC version "__VERSION__".\n";
  24. #include <unistd.h>
  25. extern void __libc_print_version (void) attribute_hidden;
  26. void
  27. __libc_print_version (void)
  28. {
  29. write (STDOUT_FILENO, banner, sizeof banner - 1);
  30. }
  31. extern const char *__gnu_get_libc_release (void);
  32. const char *
  33. __gnu_get_libc_release (void)
  34. {
  35. return __libc_release;
  36. }
  37. weak_alias (__gnu_get_libc_release, gnu_get_libc_release)
  38. extern const char *__gnu_get_libc_version (void);
  39. const char *
  40. __gnu_get_libc_version (void)
  41. {
  42. return __libc_version;
  43. }
  44. weak_alias (__gnu_get_libc_version, gnu_get_libc_version)
  45. /* This function is the entry point for the shared object.
  46. Running the library as a program will get here. */
  47. extern void __libc_main (void) __attribute__ ((noreturn));
  48. void
  49. __libc_main (void)
  50. {
  51. __libc_print_version ();
  52. _exit (0);
  53. }