From 8f153c6128dd15fb132d8ddb1752e793bd6a5985 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 18 Sep 2006 22:49:20 +0000 Subject: r18644: bring in libreplace in lib/replace metze (This used to be commit 596cbe73dd268742acf456fccd8a234376fb0c97) --- source3/lib/replace/dlfcn.c | 54 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 source3/lib/replace/dlfcn.c (limited to 'source3/lib/replace/dlfcn.c') diff --git a/source3/lib/replace/dlfcn.c b/source3/lib/replace/dlfcn.c new file mode 100644 index 0000000000..e25ac9dfe5 --- /dev/null +++ b/source3/lib/replace/dlfcn.c @@ -0,0 +1,54 @@ +/* + Unix SMB/CIFS implementation. + Samba system utilities + Copyright (C) Andrew Tridgell 1992-1998 + Copyright (C) Jeremy Allison 1998-2002 + + ** NOTE! The following LGPL license applies to the replace + ** library. This does NOT imply that all of Samba is released + ** under the LGPL + + This 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 of the License, or (at your option) any later version. + + This 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 this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "replace.h" + +#ifndef HAVE_DLOPEN +void *dlopen(const char *name, int flags) +{ + return NULL; +} +#endif + +#ifndef HAVE_DLSYM +void *dlsym(void *handle, const char *symbol) +{ + return NULL; +} +#endif + +#ifndef HAVE_DLERROR +char *dlerror(void) +{ + return "dynamic loading of objects not supported on this platform"; +} +#endif + +#ifndef HAVE_DLCLOSE +int dlclose(void *handle) +{ + return 0; +} +#endif -- cgit From 322863b392dda9ba0048c5b9efd5a5a594e2e2cc Mon Sep 17 00:00:00 2001 From: James Peach Date: Wed, 18 Oct 2006 03:26:58 +0000 Subject: r19385: These replaced symbols should have a rep_ prefix. (This used to be commit decdb46a3f7445d589c23e0ad554453ae79cd292) --- source3/lib/replace/dlfcn.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/lib/replace/dlfcn.c') diff --git a/source3/lib/replace/dlfcn.c b/source3/lib/replace/dlfcn.c index e25ac9dfe5..22f9f8bf79 100644 --- a/source3/lib/replace/dlfcn.c +++ b/source3/lib/replace/dlfcn.c @@ -26,28 +26,28 @@ #include "replace.h" #ifndef HAVE_DLOPEN -void *dlopen(const char *name, int flags) +void *rep_dlopen(const char *name, int flags) { return NULL; } #endif #ifndef HAVE_DLSYM -void *dlsym(void *handle, const char *symbol) +void *rep_dlsym(void *handle, const char *symbol) { return NULL; } #endif #ifndef HAVE_DLERROR -char *dlerror(void) +char *rep_dlerror(void) { return "dynamic loading of objects not supported on this platform"; } #endif #ifndef HAVE_DLCLOSE -int dlclose(void *handle) +int rep_dlclose(void *handle) { return 0; } -- cgit From e893d7f021d149803aa85e347e0a8acefde210ac Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 2 Jun 2007 09:10:08 +0000 Subject: r23309: sync lib/replace with SAMBA_4_0 metze (This used to be commit 20965d800fcac0c55853fb12cdd36b5836fc7e56) --- source3/lib/replace/dlfcn.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/lib/replace/dlfcn.c') diff --git a/source3/lib/replace/dlfcn.c b/source3/lib/replace/dlfcn.c index 22f9f8bf79..55b38bb9eb 100644 --- a/source3/lib/replace/dlfcn.c +++ b/source3/lib/replace/dlfcn.c @@ -26,7 +26,11 @@ #include "replace.h" #ifndef HAVE_DLOPEN +#ifdef DLOPEN_TAKES_UNSIGNED_FLAGS +void *rep_dlopen(const char *name, unsigned int flags) +#else void *rep_dlopen(const char *name, int flags) +#endif { return NULL; } -- cgit From 2c09988e46d4e917b1c53c9bda3f81a48bba4952 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 01:44:42 +0000 Subject: r23790: LGPLv3+ conversion for our LGPLv2+ library code (This used to be commit 1b78cace504f60c0f525765fbf59d9cc6506cd4d) --- source3/lib/replace/dlfcn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/replace/dlfcn.c') diff --git a/source3/lib/replace/dlfcn.c b/source3/lib/replace/dlfcn.c index 55b38bb9eb..3e2232ce80 100644 --- a/source3/lib/replace/dlfcn.c +++ b/source3/lib/replace/dlfcn.c @@ -11,7 +11,7 @@ This 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 of the License, or (at your option) any later version. + version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -- cgit From 9fa1c63578733077c0aaaeeb2fc97c3b191089cc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 03:42:26 +0000 Subject: r23798: updated old Temple Place FSF addresses to new URL (This used to be commit c676a971142d7176fd5dbf21405fca14515a0a76) --- source3/lib/replace/dlfcn.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/lib/replace/dlfcn.c') diff --git a/source3/lib/replace/dlfcn.c b/source3/lib/replace/dlfcn.c index 3e2232ce80..46aaaa4087 100644 --- a/source3/lib/replace/dlfcn.c +++ b/source3/lib/replace/dlfcn.c @@ -19,8 +19,7 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + License along with this library; if not, see . */ #include "replace.h" -- cgit From e759ca84923cf711664e7946c10e10b991ff36ca Mon Sep 17 00:00:00 2001 From: jelmer Date: Tue, 6 Nov 2007 04:26:52 +0000 Subject: Wrap native HPUX functions in dl implementation. git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25859 0c0555d6-39d7-0310-84fc-f1cc0bd64818 (This used to be commit 0ec16729299887b4a80a7e24fbd1750632276691) --- source3/lib/replace/dlfcn.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source3/lib/replace/dlfcn.c') diff --git a/source3/lib/replace/dlfcn.c b/source3/lib/replace/dlfcn.c index 46aaaa4087..42848848e8 100644 --- a/source3/lib/replace/dlfcn.c +++ b/source3/lib/replace/dlfcn.c @@ -23,6 +23,9 @@ */ #include "replace.h" +#ifdef HAVE_DL_H +#include +#endif #ifndef HAVE_DLOPEN #ifdef DLOPEN_TAKES_UNSIGNED_FLAGS @@ -31,13 +34,22 @@ void *rep_dlopen(const char *name, unsigned int flags) void *rep_dlopen(const char *name, int flags) #endif { +#ifdef HAVE_SHL_LOAD + return (void *)shl_load(name, flags, 0); +#else return NULL; +#endif } #endif #ifndef HAVE_DLSYM void *rep_dlsym(void *handle, const char *symbol) { +#ifdef HAVE_SHL_FINDSYM + void *sym_addr; + if (!shl_findsym((shl_t *)&handle, symbol, TYPE_UNDEFINED, &sym_addr)) + return sym_addr; +#endif return NULL; } #endif @@ -52,6 +64,10 @@ char *rep_dlerror(void) #ifndef HAVE_DLCLOSE int rep_dlclose(void *handle) { +#ifdef HAVE_SHL_CLOSE + return shl_unload((shl_t)handle); +#else return 0; +#endif } #endif -- cgit From 9c3f0170b396bafae33bf922d3aea00dda14bb61 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 20 Feb 2008 20:05:51 +0100 Subject: Support dlopen(NULL, ...) on HPUX. (cherry picked from commit 53c70b5f77a3b9abaab783590e66278129173d5f) (This used to be commit 8883ee2418152d58e2ce609e02105e009f8ca4e8) --- source3/lib/replace/dlfcn.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/lib/replace/dlfcn.c') diff --git a/source3/lib/replace/dlfcn.c b/source3/lib/replace/dlfcn.c index 42848848e8..3b109d7e40 100644 --- a/source3/lib/replace/dlfcn.c +++ b/source3/lib/replace/dlfcn.c @@ -35,6 +35,8 @@ void *rep_dlopen(const char *name, int flags) #endif { #ifdef HAVE_SHL_LOAD + if (name == NULL) + return PROG_HANDLE; return (void *)shl_load(name, flags, 0); #else return NULL; -- cgit