diff options
Diffstat (limited to 'gmon')
-rw-r--r-- | gmon/bb_exit_func.c | 11 | ||||
-rw-r--r-- | gmon/gmon.c | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/gmon/bb_exit_func.c b/gmon/bb_exit_func.c index 032e4f6..4ba7988 100644 --- a/gmon/bb_exit_func.c +++ b/gmon/bb_exit_func.c @@ -57,7 +57,7 @@ __bb_exit_func (void) } memcpy (&ghdr.cookie[0], GMON_MAGIC, 4); memcpy (&ghdr.version, &version, sizeof (version)); - fwrite (&ghdr, sizeof (ghdr), 1, fp); + fwrite_unlocked (&ghdr, sizeof (ghdr), 1, fp); for (ptr = __bb_head; ptr != 0; ptr = ptr->next) { @@ -66,13 +66,14 @@ __bb_exit_func (void) u_int i; tag = GMON_TAG_BB_COUNT; - fwrite (&tag, sizeof (tag), 1, fp); - fwrite (&ncounts, sizeof (ncounts), 1, fp); + fwrite_unlocked (&tag, sizeof (tag), 1, fp); + fwrite_unlocked (&ncounts, sizeof (ncounts), 1, fp); for (i = 0; i < ncounts; ++i) { - fwrite (&ptr->addresses[i], sizeof (ptr->addresses[0]), 1, fp); - fwrite (&ptr->counts[i], sizeof (ptr->counts[0]), 1, fp); + fwrite_unlocked (&ptr->addresses[i], sizeof (ptr->addresses[0]), 1, + fp); + fwrite_unlocked (&ptr->counts[i], sizeof (ptr->counts[0]), 1, fp); } } fclose (fp); diff --git a/gmon/gmon.c b/gmon/gmon.c index 834351e..a3cb936 100644 --- a/gmon/gmon.c +++ b/gmon/gmon.c @@ -58,7 +58,7 @@ struct gmonparam _gmonparam = { GMON_PROF_OFF }; static int s_scale; #define SCALE_1_TO_1 0x10000L -#define ERR(s) write(2, s, sizeof(s) - 1) +#define ERR(s) __write(2, s, sizeof(s) - 1) void moncontrol __P ((int mode)); void __moncontrol __P ((int mode)); |