sprintf (buf, "%s.%u", env, __getpid ());
snprintf (buf, sizeof (buf), "%s.%u", env, __getpid ());
write_gmon (void){    struct gmon_hdr ghdr __attribute__ ((aligned (__alignof__ (int))));    int fd = -1;    char *env;#ifndef O_NOFOLLOW# define O_NOFOLLOW	0#endif    env = getenv ("GMON_OUT_PREFIX");    if (env != NULL && !__libc_enable_secure)      {	size_t len = strlen (env);	char buf[len + 20];	sprintf (buf, "%s.%u", env, __getpid ());	fd = open_not_cancel (buf, O_CREAT|O_TRUNC|O_WRONLY|O_NOFOLLOW, 0666);      }    if (fd == -1)      {	fd = open_not_cancel ("gmon.out", O_CREAT|O_TRUNC|O_WRONLY|O_NOFOLLOW,			      0666);	if (fd < 0)	  {	    char buf[300];	    int errnum = errno;#ifdef USE_IN_LIBIO	    if (_IO_fwide (stderr, 0) > 0)	      __fwprintf (stderr, L"_mcleanup: gmon.out: %s\n",			  __strerror_r (errnum, buf, sizeof buf));	    else#endif	      fprintf (stderr, "_mcleanup: gmon.out: %s\n",		       __strerror_r (errnum, buf, sizeof buf));	    return;	  }      }    /* write gmon.out header: */    memset (&ghdr, '\0', sizeof (struct gmon_hdr));    memcpy (&ghdr.cookie[0], GMON_MAGIC, sizeof (ghdr.cookie));    *(int32_t *) ghdr.version = GMON_VERSION;    write_not_cancel (fd, &ghdr, sizeof (struct gmon_hdr));    /* write PC histogram: */    write_hist (fd);    /* write call-graph: */    write_call_graph (fd);    /* write basic-block execution counts: */    write_bb_counts (fd);    close_not_cancel_no_status (fd);}