-/* $OpenBSD: dlfcn.h,v 1.16 2022/08/20 17:39:22 tb Exp $ */
+/* $OpenBSD: dlfcn.h,v 1.17 2024/09/01 04:27:45 guenther Exp $ */
/* $NetBSD: dlfcn.h,v 1.2 1995/06/05 19:38:00 pk Exp $ */
/*
#define RTLD_DEFAULT ((void *) -2) /* Use default search algorithm. */
#define RTLD_SELF ((void *) -3) /* Search the caller itself. */
-#if __BSD_VISIBLE
-
+#if __BSD_VISIBLE || __POSIX_VISIBLE >= 202405
/*
* Structure filled in by dladdr().
*/
-typedef struct dl_info {
+typedef struct
+#if __BSD_VISIBLE
+ dl_info
+#endif
+{
const char *dli_fname; /* Pathname of shared object. */
void *dli_fbase; /* Base address of shared object. */
const char *dli_sname; /* Name of nearest symbol. */
void *dli_saddr; /* Address of nearest symbol. */
-} Dl_info;
+} Dl_info_t;
+#endif /* __BSD_VISIBLE || __POSIX_VISIBLE >= 202405 */
+
+#if __BSD_VISIBLE
+typedef Dl_info_t Dl_info;
/*
* dlctl() commands
void *dlsym(void *__restrict, const char *__restrict);
char *dlerror(void);
+#if __BSD_VISIBLE || __POSIX_VISIBLE >= 202405
+int dladdr(const void *__restrict, Dl_info_t *__restrict);
+#endif
+
#if __BSD_VISIBLE
-int dladdr(const void *, Dl_info *);
int dlctl(void *, int, void *);
#endif /* __BSD_VISIBLE */
-.\" $OpenBSD: dlfcn.3,v 1.35 2023/08/26 01:38:28 deraadt Exp $
+.\" $OpenBSD: dlfcn.3,v 1.36 2024/09/01 04:27:45 guenther Exp $
.\" $NetBSD: dlfcn.3,v 1.3 1996/01/09 19:43:34 pk Exp $
.\"
.\" Copyright (c) 1995 Paul Kranenburg
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: August 26 2023 $
+.Dd $Mdocdate: September 1 2024 $
.Dt DLOPEN 3
.Os
.Sh NAME
.Xr ld 1 ,
.Xr ld.so 1 ,
.Xr elf 5
+.Sh STANDARDS
+The
+.Fn dladdr ,
+.Fn dlclose ,
+.Fn dlerror ,
+.Fn dlopen ,
+and
+.Fn dlsym
+functions conform to
+.St -p1003.1-2024 .
.Sh HISTORY
Some of the
.Nm dl*