/* tmpnam.c (emx+gcc) */

#include <stdio.h>

int main (int argc, char *argv[])
{
  char *p;

  p = tmpnam (NULL);
  if (p == NULL)
    perror ("tmpnam");
  else
    printf ("tmpnam = %s\n", p);
  switch (argc)
    {
    case 2:
      p = tempnam (NULL, argv[1]);
      break;
    case 3:
      p = tempnam (argv[1], argv[2]);
      break;
    default:
      return (0);
    }
  if (p == NULL)
    perror ("tempnam");
  else
    printf ("tempnam = %s\n", p);
  return (0);
}
