about summary refs log tree commit diff
path: root/resolv/resolv-deprecated.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-07-19 07:55:27 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-07-19 07:56:21 +0200
commit08d4a98070c4c4f69c6d04f483d105121effba08 (patch)
tree8385e0e0976dbef1d62a28cb7dca51bbf47e3331 /resolv/resolv-deprecated.c
parent17d0407a5cac70652f3544e59505c1712b36fd1a (diff)
downloadglibc-08d4a98070c4c4f69c6d04f483d105121effba08.tar.gz
glibc-08d4a98070c4c4f69c6d04f483d105121effba08.tar.xz
glibc-08d4a98070c4c4f69c6d04f483d105121effba08.zip
resolv: Move ns_makecanon into its own file, and into libc
But only as an internal symbol, __libc_ns_makecanon.  The libresolv
ABI is preserved.  This is because the function is deprecated, and
it does not make sense to add new symbol versions for deprecated
functions.

Also reformat the implementation to GNU style.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'resolv/resolv-deprecated.c')
-rw-r--r--resolv/resolv-deprecated.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/resolv/resolv-deprecated.c b/resolv/resolv-deprecated.c
new file mode 100644
index 0000000000..cbd1078dc2
--- /dev/null
+++ b/resolv/resolv-deprecated.c
@@ -0,0 +1,35 @@
+/* Forwarders for deprecated libresolv functions which are implemented in libc.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* Some functions are used by the stub resolver implementation
+   internally and thus have to be located in libc.  They have been
+   historially exported for application use as well.  However, the
+   stub resolver dependency on those functions is not intrinsic to
+   what the stub resolver does, and it is possible that a future
+   version of the stub resolver will not need them anymore.  The
+   public symbols for these functions remain in libresolv, and are not
+   moved to libc, to avoid adding new symbol versions for legacy
+   functions.  */
+
+#include <arpa/nameser.h>
+
+int
+ns_makecanon (const char *src, char *dst, size_t dstsize)
+{
+  return __libc_ns_makecanon (src, dst, dstsize);
+}