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