Quote:
Berkeley DB is thread-agnostic, so thread-local storage isn't available
to us. |
Using "real" TLS means that you just write
static __thread buffer[1024];
or
static __declspec(thread) buffer[1024];
And the C run-time library works behind the scenes to make this buffer
thread-specific. I would be surprised if the embedded targets haven't
added this interface in the meantime, too.
Quote:
Currently, all error return strings are in text space, this is only an
issue for errors for which there is no matching text string (which
should only happen if there is a bug in the application, calling
db_strerror with an illegal value, or in Berkeley DB, returning an
illegal return vlaue). |
This is the code which is really problematic:
if (error > 0) {
if ((p = strerror(error)) != NULL)
return (p);
goto unknown_err;
}
strerror may need to dynamically allocate the return string, too. 8-(