umid.c 728 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  3. * Licensed under the GPL
  4. */
  5. #include <asm/errno.h>
  6. #include <init.h>
  7. #include <kern.h>
  8. #include <os.h>
  9. /* Changed by set_umid_arg */
  10. static int umid_inited = 0;
  11. static int __init set_umid_arg(char *name, int *add)
  12. {
  13. int err;
  14. if (umid_inited) {
  15. printf("umid already set\n");
  16. return 0;
  17. }
  18. *add = 0;
  19. err = set_umid(name);
  20. if (err == -EEXIST)
  21. printf("umid '%s' already in use\n", name);
  22. else if (!err)
  23. umid_inited = 1;
  24. return 0;
  25. }
  26. __uml_setup("umid=", set_umid_arg,
  27. "umid=<name>\n"
  28. " This is used to assign a unique identity to this UML machine and\n"
  29. " is used for naming the pid file and management console socket.\n\n"
  30. );