Improve cosmo_dlopen() documentation

This commit is contained in:
Justine Tunney 2023-12-06 06:33:50 -08:00
parent 7c39818c13
commit 4772796cd8
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
2 changed files with 30 additions and 26 deletions

View file

@ -18,14 +18,23 @@
*/
#include "libc/dlopen/dlfcn.h"
char *dlerror(void) {
return "dlopen() isn't supported by cosmo";
}
/**
* Opens dynamic shared object using host platform libc.
*
* Cosmo's `dlopen()` function is a stub that always returns NULL. An
* alternative `cosmo_dlopen()` implementation is provided, which can
* help some users with tasks like talking to GPU and GUI libraries.
*
* @return null always
*/
void *dlopen(const char *, int) {
return 0;
}
char *dlerror(void) {
return "dlopen() isn't supported by cosmo; try using cosmo_dlopen()";
}
void *dlsym(void *, const char *) {
return 0;
}