/*
* Misc.
*/
-#define g_atexit(func) ((void) atexit (func))
const gchar * g_getenv(const gchar *variable);
gboolean g_setenv(const gchar *variable, const gchar *value, gboolean overwrite);
#include <mono/io-layer/process-private.h>
#include <mono/utils/mono-mutex.h>
+#include <mono/utils/mono-proclib.h>
#undef DEBUG_REFS
#if 0
wapi_processes_init ();
- /* Using g_atexit here instead of an explicit function call in
+ /* Using atexit here instead of an explicit function call in
* a cleanup routine lets us cope when a third-party library
* calls exit (eg if an X client loses the connection to its
* server.)
*/
- g_atexit (handle_cleanup);
+ mono_atexit (handle_cleanup);
}
void
#include <mono/metadata/metadata.h>
#include <mono/metadata/threadpool.h>
#include <mono/utils/mono-signal-handler.h>
+#include <mono/utils/mono-proclib.h>
/* On solaris, curses.h must come before both termios.h and term.h */
#ifdef HAVE_CURSES_H
if (teardown != NULL)
teardown_str = mono_string_to_utf8 (teardown);
- atexit (tty_teardown);
+ mono_atexit (tty_teardown);
}
return TRUE;
header->stats_start = sizeof (SAreaHeader);
header->stats_end = sizeof (SAreaHeader);
- atexit (mono_shared_area_remove);
+ mono_atexit (mono_shared_area_remove);
return res;
}
return value;
}
+int
+mono_atexit (void (*func)(void))
+{
+#ifdef PLATFORM_ANDROID
+ /* Some versions of android libc doesn't define atexit () */
+ return 0;
+#else
+ return atexit (func);
+#endif
+}
int mono_cpu_count (void) MONO_INTERNAL;
gint64 mono_cpu_get_data (int cpu_id, MonoCpuData data, MonoProcessError *error) MONO_INTERNAL;
+int mono_atexit (void (*func)(void)) MONO_INTERNAL;
+
#endif /* __MONO_PROC_LIB_H__ */