diff options
Diffstat (limited to 'mit-pthreads/gen/eprintf.c')
-rw-r--r-- | mit-pthreads/gen/eprintf.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mit-pthreads/gen/eprintf.c b/mit-pthreads/gen/eprintf.c new file mode 100644 index 00000000000..bcc65757bd4 --- /dev/null +++ b/mit-pthreads/gen/eprintf.c @@ -0,0 +1,18 @@ +/* This function is a replacement for the version in libgcc.a. This + is needed because typically libgcc.a won't have been compiled + against the threads library, so its references to "stderr" will + come out wrong. */ + +#include <stdio.h> + +void __eprintf (const char *fmt, const char *expr, int line, const char *file) +{ + /* Considering the very special circumstances where this function + would be called, perhaps we might want to disable the thread + scheduler and break any existing locks on stderr? Well, maybe if + we could be sure that stderr was in a useable state... */ + fprintf (stderr, fmt, expr, line, file); + fflush (stderr); + + abort (); +} |