stdlib_r.h File Reference

_malloc_r

EPOC32 malloc uses the thread heap, so it is already thread-safe and no _malloc_r variants are needed.

_calloc_r

_realloc_r

_free_r

_dtoa_r ( struct _reent *, double, int, int, int *, int *, char ** )

IMPORT_C char *_dtoa_r(struct _reent *,
double,
int,
int,
int *,
int *,
char **
)

_mstats_r ( struct _reent *, char * )

IMPORT_C void_mstats_r(struct _reent *,
char *
)

_system_r ( struct _reent *, const char * )

IMPORT_C int_system_r(struct _reent *,
const char *
)

A reentrant version of system().

_wsystem_r ( struct _reent *, const wchar_t * )

IMPORT_C int_wsystem_r(struct _reent *,
const wchar_t *
)

A wide-character version of reentrant of system().

_rand_r ( struct _reent * )

IMPORT_C int_rand_r(struct _reent *)

Reentrant versions of rand()

_srand_r ( struct _reent *, unsigned )

IMPORT_C void_srand_r(struct _reent *,
unsigned
)

_setenv_r ( struct _reent *, const char *, const char *, int )

IMPORT_C int_setenv_r(struct _reent *,
const char *,
const char *,
int
)

A reentrant version of setenv().

_unsetenv_r ( struct _reent *, const char * )

IMPORT_C void_unsetenv_r(struct _reent *,
const char *
)

A reentrant version of unsetenv().

_getenv_r ( struct _reent *, const char * )

IMPORT_C char *_getenv_r(struct _reent *,
const char *
)

A reentrant version of getenv().

_wsetenv_r ( struct _reent *, const wchar_t *, const wchar_t *, int )

IMPORT_C int_wsetenv_r(struct _reent *,
const wchar_t *,
const wchar_t *,
int
)

A reentrant version of wsetenv().

_wunsetenv_r ( struct _reent *, const wchar_t * )

IMPORT_C void_wunsetenv_r(struct _reent *,
const wchar_t *
)

A reentrant version of wunsetenv().

_wgetenv_r ( struct _reent *, const wchar_t * )

IMPORT_C wchar_t *_wgetenv_r(struct _reent *,
const wchar_t *
)

A reentrant version of wgetenv().

_strtoul_r ( struct _reent *, const char *, char **, int )

IMPORT_C unsigned long_strtoul_r(struct _reent *,
const char *,
char **,
int
)

_atexit_processing_r ( struct _reent * )

IMPORT_C void_atexit_processing_r(struct _reent *)

It's possible to override exit() by supplying abort(), exit() and _exit() The generic exit() and abort() routines look like

void exit(int code) _ATTRIBUTE((noreturn)) { _atexit_processing_r(_REENT); _exit(code); } void abort(void) _ATTRIBUTE((noreturn)) { _exit(1); }

which then allows your _exit() to capture all exits from ESTLIB, except for __assert() which calls abort().