#include <stdio.h>
main()
{
  char buf[30];
  int err = 1;
  FILE *pos, *un;

  pos = fopen ("posix_errors.h", "w");
  un = fopen ("errno.h", "w");

  fprintf (pos, "#include <sys/errno.h>\n");
  fprintf (pos, "#define err_posix err_system(0x10)\n");

  while (gets(buf))
    {
      fprintf (pos, "#define POSIX_%s (err_posix|err_sub(0)|%s)\n", buf, buf);
      fprintf (un, "#define %s %d\n", buf, err++);
    }
}
