* doc/make.texi: Document temporary file name prefix

* src/posixos.c (jobserver_setup): Set prefix for FIFO temp file.
Ensure it can't conflict with a "normal" temp file.
* src/w32/w32os.c (os_anontmp): Set prefix for anon temp files.
diff --git a/doc/make.texi b/doc/make.texi
index 5efae41..874152f 100644
--- a/doc/make.texi
+++ b/doc/make.texi
@@ -9462,7 +9462,8 @@
 
 In some situations, @code{make} will need to create its own temporary files.
 These files must not be disturbed while @code{make} is running, including all
-recursively-invoked instances of @code{make}.
+recursively-invoked instances of @code{make}.  All temporary filenames created
+by GNU Make will start with the letters @samp{Gm}.
 
 @cindex @code{MAKE_TMPDIR}
 If the environment variable @code{MAKE_TMPDIR} is set then all temporary files
diff --git a/src/posixos.c b/src/posixos.c
index 7a72359..6b0b716 100644
--- a/src/posixos.c
+++ b/src/posixos.c
@@ -152,13 +152,14 @@
     {
   /* Unfortunately glibc warns about uses of mktemp even though we aren't
      using it in dangerous way here.  So avoid this by generating our own
-     temporary file name.  */
-# define  FNAME_PREFIX "GMfifo"
+     temporary file name.  The template in misc.c uses 6 X's so be sure this
+     name cannot conflict with that.  */
+# define  FNAME_PREFIX "GmFIFO"
       const char *tmpdir = get_tmpdir ();
 
       fifo_name = xmalloc (strlen (tmpdir) + CSTRLEN (FNAME_PREFIX)
                            + INTSTR_LENGTH + 2);
-      sprintf (fifo_name, "%s/" FNAME_PREFIX "%" MK_PRI64_PREFIX "d",
+      sprintf (fifo_name, "%s/" FNAME_PREFIX "%03" MK_PRI64_PREFIX "d",
                tmpdir, (long long)make_pid ());
 
       EINTRLOOP (r, mkfifo (fifo_name, 0600));
diff --git a/src/w32/w32os.c b/src/w32/w32os.c
index ac8fc59..af02621 100644
--- a/src/w32/w32os.c
+++ b/src/w32/w32os.c
@@ -129,7 +129,7 @@
   static unsigned uniq = 0;
   static int second_loop = 0;
 
-  const char base[] = "gmake_tmpf";
+  const char base[] = "GmTMPF";
   const unsigned sizemax = sizeof (base) - 1 + 4 + 10 + 10;
   unsigned pid = GetCurrentProcessId ();