Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com) |
| 3 | * Licensed under the GPL |
| 4 | */ |
| 5 | |
Jeff Dike | 2264c47 | 2006-01-06 00:18:59 -0800 | [diff] [blame] | 6 | #include "asm/errno.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | #include "init.h" |
| 8 | #include "os.h" |
Jeff Dike | 2264c47 | 2006-01-06 00:18:59 -0800 | [diff] [blame] | 9 | #include "kern.h" |
Jeff Dike | 7eebe8a | 2006-01-06 00:19:01 -0800 | [diff] [blame] | 10 | #include "linux/kernel.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | |
Jeff Dike | 7eebe8a | 2006-01-06 00:19:01 -0800 | [diff] [blame] | 12 | /* Changed by set_umid_arg */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | static int umid_inited = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | |
| 15 | static int __init set_umid_arg(char *name, int *add) |
| 16 | { |
Jeff Dike | 2264c47 | 2006-01-06 00:18:59 -0800 | [diff] [blame] | 17 | int err; |
| 18 | |
| 19 | if(umid_inited) |
| 20 | return 0; |
| 21 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | *add = 0; |
Jeff Dike | 7eebe8a | 2006-01-06 00:19:01 -0800 | [diff] [blame] | 23 | err = set_umid(name); |
| 24 | if(err == -EEXIST) |
Jeff Dike | 2264c47 | 2006-01-06 00:18:59 -0800 | [diff] [blame] | 25 | printf("umid '%s' already in use\n", name); |
Jeff Dike | 2264c47 | 2006-01-06 00:18:59 -0800 | [diff] [blame] | 26 | else if(!err) |
| 27 | umid_inited = 1; |
| 28 | |
| 29 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | __uml_setup("umid=", set_umid_arg, |
| 33 | "umid=<name>\n" |
| 34 | " This is used to assign a unique identity to this UML machine and\n" |
| 35 | " is used for naming the pid file and management console socket.\n\n" |
| 36 | ); |
| 37 | |