compat-hooks.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* Compatibility functions for obsolete libresolv hooks.
  2. Copyright (C) 1999-2026 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  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.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <https://www.gnu.org/licenses/>. */
  15. /*
  16. * Copyright (c) 1995-1999 by Internet Software Consortium.
  17. *
  18. * Permission to use, copy, modify, and distribute this software for any
  19. * purpose with or without fee is hereby granted, provided that the above
  20. * copyright notice and this permission notice appear in all copies.
  21. *
  22. * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
  23. * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
  24. * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
  25. * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  26. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  27. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  28. * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  29. * SOFTWARE.
  30. */
  31. #include <resolv.h>
  32. #include <shlib-compat.h>
  33. #if SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_25)
  34. void
  35. attribute_compat_text_section
  36. res_send_setqhook(void *hook) {
  37. _res.__glibc_unused_qhook = hook;
  38. }
  39. compat_symbol (libresolv, res_send_setqhook, res_send_setqhook, GLIBC_2_0);
  40. void
  41. attribute_compat_text_section
  42. res_send_setrhook(void *hook) {
  43. _res.__glibc_unused_rhook = hook;
  44. }
  45. compat_symbol (libresolv, res_send_setrhook, res_send_setrhook, GLIBC_2_0);
  46. #endif