]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Forward-port google-nsl-stub
authorPaul Pluzhnikov <ppluzhnikov@google.com>
Fri, 28 Feb 2014 14:44:46 +0000 (06:44 -0800)
committerFangrui Song <i@maskray.me>
Sat, 28 Aug 2021 00:26:04 +0000 (17:26 -0700)
google-nsl-stub/Makefile [new file with mode: 0644]
google-nsl-stub/configure [new file with mode: 0644]
google-nsl-stub/shlib-versions [new file with mode: 0644]
google-nsl-stub/ypclnt.c [new file with mode: 0644]

diff --git a/google-nsl-stub/Makefile b/google-nsl-stub/Makefile
new file mode 100644 (file)
index 0000000..ef5b6a6
--- /dev/null
@@ -0,0 +1,32 @@
+# Copyright (C) 2003-2013 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
+# <http://www.gnu.org/licenses/>.
+
+# Makefile for google-nsl-stub add-on subdirectory of GNU C Library.
+# Based on libidn/Makefile.
+
+subdir := google-nsl-stub
+
+extra-libs             = libnsl
+extra-libs-others      = $(extra-libs)
+
+libnsl-routines := ypclnt
+
+include $(..)Makeconfig
+
+libnsl-inhibit-o = $(filter-out .os,$(object-suffixes))
+
+include $(..)Rules
diff --git a/google-nsl-stub/configure b/google-nsl-stub/configure
new file mode 100644 (file)
index 0000000..c901084
--- /dev/null
@@ -0,0 +1,6 @@
+# This is a shell script fragment sourced by the main configure script.
+# We're obliged to give here the canonical name that will be used to
+# as a subdirectory to search for in other add-ons' sysdeps trees.
+
+libc_add_on_canonical=google-nsl-stub
+libc_add_on_subdirs=.
diff --git a/google-nsl-stub/shlib-versions b/google-nsl-stub/shlib-versions
new file mode 100644 (file)
index 0000000..ca13c8c
--- /dev/null
@@ -0,0 +1 @@
+.*-.*-.*       libnsl=1
diff --git a/google-nsl-stub/ypclnt.c b/google-nsl-stub/ypclnt.c
new file mode 100644 (file)
index 0000000..67867fe
--- /dev/null
@@ -0,0 +1,42 @@
+/* Copyright (C) 2013 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
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is a Google-local stub version of nis/ypclnt.c.  These functions
+   are required for dynamic linking of some precompiled executables.  */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+int yp_get_default_domain(char **domp) {
+  /* We duplicate glibc's error behavior and return a null pointer.  */
+  *domp = NULL;
+  return 12; /* YPERR_NODOM */
+}
+
+static const char err[] = "not implemented in Google-local stub";
+char *yperr_string(int incode) {
+  return err;
+}
+
+int yp_match(char *indomain, char *inmap, const char *inkey, int inkeylen,
+             char **outval, int *outvallen) {
+  *outval = malloc(2);
+  (*outval)[0] = '\n';
+  (*outval)[1] = '\0';
+  *outvallen = 0;
+  return 0;
+}