From 130e2180398d23fec3228f9507d84791e738b826 Mon Sep 17 00:00:00 2001 From: midipix Date: Jun 21 2025 18:17:52 +0000 Subject: api: lt_dlseterror(): initial implementation. --- diff --git a/include/sltdl/sltdl.h b/include/sltdl/sltdl.h index f9cc483..007d5ee 100644 --- a/include/sltdl/sltdl.h +++ b/include/sltdl/sltdl.h @@ -136,6 +136,9 @@ lt_api int lt_dlpreload_default(const struct lt_symdef *); lt_api int lt_dlloader_add(const struct lt_dlentry *); lt_api const struct lt_dlentry * lt_dlloader_find(const char *); +/* custom errors */ +lt_api int lt_dlseterror (int); + #ifdef __cplusplus } #endif diff --git a/src/core/lt_core.c b/src/core/lt_core.c index e3cadd4..031701a 100644 --- a/src/core/lt_core.c +++ b/src/core/lt_core.c @@ -130,3 +130,10 @@ const char * lt_dlerror(void) return errdesc; } + +int lt_dlseterror(int errcode) +{ + lt_slock(); + lt_sunlock(0,errcode); + return 0; +}