}
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)
{
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);
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));