Hooks now take a file descriptor, not a FILE
#include "rtsdefs.h"
void
#include "rtsdefs.h"
void
-ErrorHdrHook (FILE *where)
+ErrorHdrHook (StgInt fd)
- fflush( stdout ); /* Flush out any pending output */
-
- fprintf(where, "\nFail: ");
+ const char msg[]="\nFail: ";
+ write(fd,msg,sizeof(msg)-1);
#include "rtsdefs.h"
void
#include "rtsdefs.h"
void
-IOErrorHdrHook (FILE *where)
+IOErrorHdrHook (StgInt fd)
- fflush( stdout ); /* Flush out any pending output */
-
- fprintf(where, "\nI/O error: ");
+ const char msg[]="\nI/O error: ";
+ write(fd, msg, sizeof(msg)-1);
#include "rtsdefs.h"
void
#include "rtsdefs.h"
void
-PatErrorHdrHook (FILE *where)
+PatErrorHdrHook (StgInt fd)
- fflush( stdout ); /* Flush out any pending output */
-
- fprintf(where, "\nFail: ");
+ const char msg[]="\nFail: ";
+ write(fd,msg,sizeof(msg)-1);
#include "rtsdefs.h"
void
#include "rtsdefs.h"
void
-PreTraceHook (FILE *where)
+PreTraceHook (StgInt fd)
- fprintf(where, "Trace On:\n");
+/* By default, a trace msg doesn't have a header (nor a footer) */
+#if 0
+ const char msg[]="Trace On:\n";
+ write(fd,msg,sizeof(msg)-1);
+#endif
-PostTraceHook (FILE *where)
+PostTraceHook (StgInt fd)
- fprintf(where, "\nTrace Off.\n");
+#if 0
+ const char msg[]="\nTrace Off.\n";
+ write(fd,msg,sizeof(msg)-1);
+#endif