appscope
appscope copied to clipboard
Use only scopestdlib layer for all functions
After talking with @iapaddler:
Currently, we are using scopesdtlib.h/scopesdtlib.c
as a proxy layer to call functions from internal library e.g. functions with scopelibc
prefix.
Some of the functions called in the context of our code are not using intentionally from the internal library the examples are getenv, setenv, dlopen
.
What we can do is consolidate our code to always call scope_
function variant, but the exact implementation can be different than simply wrapper to scopelibc
function. Therefore in the context of our action, we would always use scope_
variant
E.g.:
FILE*
scope_fopen( const char * filename, const char * mode) {
return scopelibc_fopen(filename, mode);
}
char*
scope_getenv(const char *name) {
return getenv(name);
}
In this way, we could avoid confusion about which function should be called.
Potential issue:
- after consolidation figure out to which errno we should look when calling scope