diff options
author | Serge E. Hallyn <serue@us.ibm.com> | 2006-10-02 05:18:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-02 10:57:21 -0400 |
commit | e9ff3990f08e9a0c2839cc22808b01732ea5b3e4 (patch) | |
tree | c638a7b89f0c5e8adc410316d06ca1de8b8dabee /arch/parisc/hpux | |
parent | 0bdd7aab7f0ecd5d337910816aa058c18398628e (diff) |
[PATCH] namespaces: utsname: switch to using uts namespaces
Replace references to system_utsname to the per-process uts namespace
where appropriate. This includes things like uname.
Changes: Per Eric Biederman's comments, use the per-process uts namespace
for ELF_PLATFORM, sunrpc, and parts of net/ipv4/ipconfig.c
[jdike@addtoit.com: UML fix]
[clg@fr.ibm.com: cleanup]
[akpm@osdl.org: build fix]
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Cc: Kirill Korotaev <dev@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Andrey Savochkin <saw@sw.ru>
Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/parisc/hpux')
-rw-r--r-- | arch/parisc/hpux/sys_hpux.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/arch/parisc/hpux/sys_hpux.c b/arch/parisc/hpux/sys_hpux.c index cb69727027ae..2e2dc4f2c853 100644 --- a/arch/parisc/hpux/sys_hpux.c +++ b/arch/parisc/hpux/sys_hpux.c | |||
@@ -266,16 +266,21 @@ static int hpux_uname(struct hpux_utsname *name) | |||
266 | 266 | ||
267 | down_read(&uts_sem); | 267 | down_read(&uts_sem); |
268 | 268 | ||
269 | error = __copy_to_user(&name->sysname,&system_utsname.sysname,HPUX_UTSLEN-1); | 269 | error = __copy_to_user(&name->sysname, &utsname()->sysname, |
270 | error |= __put_user(0,name->sysname+HPUX_UTSLEN-1); | 270 | HPUX_UTSLEN - 1); |
271 | error |= __copy_to_user(&name->nodename,&system_utsname.nodename,HPUX_UTSLEN-1); | 271 | error |= __put_user(0, name->sysname + HPUX_UTSLEN - 1); |
272 | error |= __put_user(0,name->nodename+HPUX_UTSLEN-1); | 272 | error |= __copy_to_user(&name->nodename, &utsname()->nodename, |
273 | error |= __copy_to_user(&name->release,&system_utsname.release,HPUX_UTSLEN-1); | 273 | HPUX_UTSLEN - 1); |
274 | error |= __put_user(0,name->release+HPUX_UTSLEN-1); | 274 | error |= __put_user(0, name->nodename + HPUX_UTSLEN - 1); |
275 | error |= __copy_to_user(&name->version,&system_utsname.version,HPUX_UTSLEN-1); | 275 | error |= __copy_to_user(&name->release, &utsname()->release, |
276 | error |= __put_user(0,name->version+HPUX_UTSLEN-1); | 276 | HPUX_UTSLEN - 1); |
277 | error |= __copy_to_user(&name->machine,&system_utsname.machine,HPUX_UTSLEN-1); | 277 | error |= __put_user(0, name->release + HPUX_UTSLEN - 1); |
278 | error |= __put_user(0,name->machine+HPUX_UTSLEN-1); | 278 | error |= __copy_to_user(&name->version, &utsname()->version, |
279 | HPUX_UTSLEN - 1); | ||
280 | error |= __put_user(0, name->version + HPUX_UTSLEN - 1); | ||
281 | error |= __copy_to_user(&name->machine, &utsname()->machine, | ||
282 | HPUX_UTSLEN - 1); | ||
283 | error |= __put_user(0, name->machine + HPUX_UTSLEN - 1); | ||
279 | 284 | ||
280 | up_read(&uts_sem); | 285 | up_read(&uts_sem); |
281 | 286 | ||
@@ -373,8 +378,8 @@ int hpux_utssys(char *ubuf, int n, int type) | |||
373 | /* TODO: print a warning about using this? */ | 378 | /* TODO: print a warning about using this? */ |
374 | down_write(&uts_sem); | 379 | down_write(&uts_sem); |
375 | error = -EFAULT; | 380 | error = -EFAULT; |
376 | if (!copy_from_user(system_utsname.sysname, ubuf, len)) { | 381 | if (!copy_from_user(utsname()->sysname, ubuf, len)) { |
377 | system_utsname.sysname[len] = 0; | 382 | utsname()->sysname[len] = 0; |
378 | error = 0; | 383 | error = 0; |
379 | } | 384 | } |
380 | up_write(&uts_sem); | 385 | up_write(&uts_sem); |
@@ -400,8 +405,8 @@ int hpux_utssys(char *ubuf, int n, int type) | |||
400 | /* TODO: print a warning about this? */ | 405 | /* TODO: print a warning about this? */ |
401 | down_write(&uts_sem); | 406 | down_write(&uts_sem); |
402 | error = -EFAULT; | 407 | error = -EFAULT; |
403 | if (!copy_from_user(system_utsname.release, ubuf, len)) { | 408 | if (!copy_from_user(utsname()->release, ubuf, len)) { |
404 | system_utsname.release[len] = 0; | 409 | utsname()->release[len] = 0; |
405 | error = 0; | 410 | error = 0; |
406 | } | 411 | } |
407 | up_write(&uts_sem); | 412 | up_write(&uts_sem); |
@@ -422,13 +427,13 @@ int hpux_getdomainname(char *name, int len) | |||
422 | 427 | ||
423 | down_read(&uts_sem); | 428 | down_read(&uts_sem); |
424 | 429 | ||
425 | nlen = strlen(system_utsname.domainname) + 1; | 430 | nlen = strlen(utsname()->domainname) + 1; |
426 | 431 | ||
427 | if (nlen < len) | 432 | if (nlen < len) |
428 | len = nlen; | 433 | len = nlen; |
429 | if(len > __NEW_UTS_LEN) | 434 | if(len > __NEW_UTS_LEN) |
430 | goto done; | 435 | goto done; |
431 | if(copy_to_user(name, system_utsname.domainname, len)) | 436 | if(copy_to_user(name, utsname()->domainname, len)) |
432 | goto done; | 437 | goto done; |
433 | err = 0; | 438 | err = 0; |
434 | done: | 439 | done: |