[PATCH] namespaces: utsname: switch to using uts namespaces
authorSerge E. Hallyn <serue@us.ibm.com>
Mon, 2 Oct 2006 09:18:11 +0000 (02:18 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 2 Oct 2006 14:57:21 +0000 (07:57 -0700)
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>
35 files changed:
arch/alpha/kernel/osf_sys.c
arch/i386/kernel/sys_i386.c
arch/ia64/sn/kernel/sn2/sn_hwperf.c
arch/m32r/kernel/sys_m32r.c
arch/mips/kernel/linux32.c
arch/mips/kernel/syscall.c
arch/mips/kernel/sysirix.c
arch/parisc/hpux/sys_hpux.c
arch/powerpc/kernel/syscalls.c
arch/sh/kernel/sys_sh.c
arch/sh64/kernel/sys_sh64.c
arch/sparc/kernel/sys_sparc.c
arch/sparc/kernel/sys_sunos.c
arch/sparc64/kernel/sys_sparc.c
arch/sparc64/kernel/sys_sunos32.c
arch/sparc64/solaris/misc.c
arch/um/drivers/mconsole_kern.c
arch/um/kernel/syscall.c
arch/um/sys-x86_64/syscalls.c
arch/x86_64/ia32/sys_ia32.c
arch/x86_64/kernel/sys_x86_64.c
arch/xtensa/kernel/syscalls.c
drivers/char/random.c
fs/cifs/connect.c
fs/exec.c
fs/lockd/clntproc.c
fs/lockd/mon.c
fs/lockd/svclock.c
fs/lockd/xdr.c
fs/nfs/nfsroot.c
include/asm-i386/elf.h
include/linux/lockd/lockd.h
kernel/sys.c
net/ipv4/ipconfig.c
net/sunrpc/clnt.c

index 73c7622b529755d2d42def44da80ee335c631df7..8a31fc1bfb15b69671f5ce335bea378d818a8d54 100644 (file)
@@ -402,15 +402,15 @@ osf_utsname(char __user *name)
 
        down_read(&uts_sem);
        error = -EFAULT;
-       if (copy_to_user(name + 0, system_utsname.sysname, 32))
+       if (copy_to_user(name + 0, utsname()->sysname, 32))
                goto out;
-       if (copy_to_user(name + 32, system_utsname.nodename, 32))
+       if (copy_to_user(name + 32, utsname()->nodename, 32))
                goto out;
-       if (copy_to_user(name + 64, system_utsname.release, 32))
+       if (copy_to_user(name + 64, utsname()->release, 32))
                goto out;
-       if (copy_to_user(name + 96, system_utsname.version, 32))
+       if (copy_to_user(name + 96, utsname()->version, 32))
                goto out;
-       if (copy_to_user(name + 128, system_utsname.machine, 32))
+       if (copy_to_user(name + 128, utsname()->machine, 32))
                goto out;
 
        error = 0;
@@ -449,8 +449,8 @@ osf_getdomainname(char __user *name, int namelen)
 
        down_read(&uts_sem);
        for (i = 0; i < len; ++i) {
-               __put_user(system_utsname.domainname[i], name + i);
-               if (system_utsname.domainname[i] == '\0')
+               __put_user(utsname()->domainname[i], name + i);
+               if (utsname()->domainname[i] == '\0')
                        break;
        }
        up_read(&uts_sem);
@@ -607,12 +607,12 @@ osf_sigstack(struct sigstack __user *uss, struct sigstack __user *uoss)
 asmlinkage long
 osf_sysinfo(int command, char __user *buf, long count)
 {
-       static char * sysinfo_table[] = {
-               system_utsname.sysname,
-               system_utsname.nodename,
-               system_utsname.release,
-               system_utsname.version,
-               system_utsname.machine,
+       char *sysinfo_table[] = {
+               utsname()->sysname,
+               utsname()->nodename,
+               utsname()->release,
+               utsname()->version,
+               utsname()->machine,
                "alpha",        /* instruction set architecture */
                "dummy",        /* hardware serial number */
                "dummy",        /* hardware manufacturer */
index 8fdb1fb17a5f0ca457cdf0bdaa8e3d998fcd0ccf..dc6e3bbeba31a67a8e985e84468e6e9c70a71e3e 100644 (file)
@@ -210,7 +210,7 @@ asmlinkage int sys_uname(struct old_utsname __user * name)
        if (!name)
                return -EFAULT;
        down_read(&uts_sem);
-       err=copy_to_user(name, &system_utsname, sizeof (*name));
+       err = copy_to_user(name, utsname(), sizeof (*name));
        up_read(&uts_sem);
        return err?-EFAULT:0;
 }
@@ -226,16 +226,21 @@ asmlinkage int sys_olduname(struct oldold_utsname __user * name)
   
        down_read(&uts_sem);
        
-       error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN);
-       error |= __put_user(0,name->sysname+__OLD_UTS_LEN);
-       error |= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN);
-       error |= __put_user(0,name->nodename+__OLD_UTS_LEN);
-       error |= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN);
-       error |= __put_user(0,name->release+__OLD_UTS_LEN);
-       error |= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
-       error |= __put_user(0,name->version+__OLD_UTS_LEN);
-       error |= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
-       error |= __put_user(0,name->machine+__OLD_UTS_LEN);
+       error = __copy_to_user(&name->sysname, &utsname()->sysname,
+                              __OLD_UTS_LEN);
+       error |= __put_user(0, name->sysname + __OLD_UTS_LEN);
+       error |= __copy_to_user(&name->nodename, &utsname()->nodename,
+                               __OLD_UTS_LEN);
+       error |= __put_user(0, name->nodename + __OLD_UTS_LEN);
+       error |= __copy_to_user(&name->release, &utsname()->release,
+                               __OLD_UTS_LEN);
+       error |= __put_user(0, name->release + __OLD_UTS_LEN);
+       error |= __copy_to_user(&name->version, &utsname()->version,
+                               __OLD_UTS_LEN);
+       error |= __put_user(0, name->version + __OLD_UTS_LEN);
+       error |= __copy_to_user(&name->machine, &utsname()->machine,
+                               __OLD_UTS_LEN);
+       error |= __put_user(0, name->machine + __OLD_UTS_LEN);
        
        up_read(&uts_sem);
        
index b632b9c1e3b3e1785ffdc6b678e495c59b805dba..462ea178f49abadfed37375141629013fda98e62 100644 (file)
@@ -423,7 +423,7 @@ static int sn_topology_show(struct seq_file *s, void *d)
                        "coherency_domain %d, "
                        "region_size %d\n",
 
-                       partid, system_utsname.nodename,
+                       partid, utsname()->nodename,
                        shubtype ? "shub2" : "shub1", 
                        (u64)nasid_mask << nasid_shift, nasid_msb, nasid_shift,
                        system_size, sharing_size, coher, region_size);
index a9cea32eb8246286924667bbef46291547297696..7c29396cc6708f689d6a015aa04da4a55b9e9636 100644 (file)
@@ -205,7 +205,7 @@ asmlinkage int sys_uname(struct old_utsname * name)
        if (!name)
                return -EFAULT;
        down_read(&uts_sem);
-       err=copy_to_user(name, &system_utsname, sizeof (*name));
+       err = copy_to_user(name, utsname(), sizeof (*name));
        up_read(&uts_sem);
        return err?-EFAULT:0;
 }
index 43b1162d714f281db07a3bad5b53bcf0576f8423..52cada45b3538f6012b3dac0750a8f1fb06e3da0 100644 (file)
@@ -1039,7 +1039,7 @@ asmlinkage long sys32_newuname(struct new_utsname __user * name)
        int ret = 0;
 
        down_read(&uts_sem);
-       if (copy_to_user(name,&system_utsname,sizeof *name))
+       if (copy_to_user(name, utsname(), sizeof *name))
                ret = -EFAULT;
        up_read(&uts_sem);
 
index 9951240cc3fd23fde7c356542534de4c79a904af..970e3e96b1d0ccd222b32b845a57108bb75ec0c5 100644 (file)
@@ -231,7 +231,7 @@ out:
  */
 asmlinkage int sys_uname(struct old_utsname __user * name)
 {
-       if (name && !copy_to_user(name, &system_utsname, sizeof (*name)))
+       if (name && !copy_to_user(name, utsname(), sizeof (*name)))
                return 0;
        return -EFAULT;
 }
@@ -248,16 +248,21 @@ asmlinkage int sys_olduname(struct oldold_utsname __user * name)
        if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
                return -EFAULT;
 
-       error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN);
-       error -= __put_user(0,name->sysname+__OLD_UTS_LEN);
-       error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN);
-       error -= __put_user(0,name->nodename+__OLD_UTS_LEN);
-       error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN);
-       error -= __put_user(0,name->release+__OLD_UTS_LEN);
-       error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
-       error -= __put_user(0,name->version+__OLD_UTS_LEN);
-       error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
-       error = __put_user(0,name->machine+__OLD_UTS_LEN);
+       error = __copy_to_user(&name->sysname, &utsname()->sysname,
+                              __OLD_UTS_LEN);
+       error -= __put_user(0, name->sysname + __OLD_UTS_LEN);
+       error -= __copy_to_user(&name->nodename, &utsname()->nodename,
+                               __OLD_UTS_LEN);
+       error -= __put_user(0, name->nodename + __OLD_UTS_LEN);
+       error -= __copy_to_user(&name->release, &utsname()->release,
+                               __OLD_UTS_LEN);
+       error -= __put_user(0, name->release + __OLD_UTS_LEN);
+       error -= __copy_to_user(&name->version, &utsname()->version,
+                               __OLD_UTS_LEN);
+       error -= __put_user(0, name->version + __OLD_UTS_LEN);
+       error -= __copy_to_user(&name->machine, &utsname()->machine,
+                               __OLD_UTS_LEN);
+       error = __put_user(0, name->machine + __OLD_UTS_LEN);
        error = error ? -EFAULT : 0;
 
        return error;
index 1137dd6ea7aa914bd91c3ec10722c843ef531ebe..11bb971749728dbf7916eea4b5ac8e7818d2238f 100644 (file)
@@ -884,7 +884,7 @@ asmlinkage int irix_getdomainname(char __user *name, int len)
        down_read(&uts_sem);
        if (len > __NEW_UTS_LEN)
                len = __NEW_UTS_LEN;
-       err = copy_to_user(name, system_utsname.domainname, len) ? -EFAULT : 0;
+       err = copy_to_user(name, utsname()->domainname, len) ? -EFAULT : 0;
        up_read(&uts_sem);
 
        return err;
@@ -1127,11 +1127,11 @@ struct iuname {
 asmlinkage int irix_uname(struct iuname __user *buf)
 {
        down_read(&uts_sem);
-       if (copy_from_user(system_utsname.sysname, buf->sysname, 65)
-           || copy_from_user(system_utsname.nodename, buf->nodename, 65)
-           || copy_from_user(system_utsname.release, buf->release, 65)
-           || copy_from_user(system_utsname.version, buf->version, 65)
-           || copy_from_user(system_utsname.machine, buf->machine, 65)) {
+       if (copy_from_user(utsname()->sysname, buf->sysname, 65)
+           || copy_from_user(utsname()->nodename, buf->nodename, 65)
+           || copy_from_user(utsname()->release, buf->release, 65)
+           || copy_from_user(utsname()->version, buf->version, 65)
+           || copy_from_user(utsname()->machine, buf->machine, 65)) {
                return -EFAULT;
        }
        up_read(&uts_sem);
index cb69727027aecf66889bad82a29e947bf87cb994..2e2dc4f2c853edee44818110eee1d44e5d85d1b9 100644 (file)
@@ -266,16 +266,21 @@ static int hpux_uname(struct hpux_utsname *name)
 
        down_read(&uts_sem);
 
-       error = __copy_to_user(&name->sysname,&system_utsname.sysname,HPUX_UTSLEN-1);
-       error |= __put_user(0,name->sysname+HPUX_UTSLEN-1);
-       error |= __copy_to_user(&name->nodename,&system_utsname.nodename,HPUX_UTSLEN-1);
-       error |= __put_user(0,name->nodename+HPUX_UTSLEN-1);
-       error |= __copy_to_user(&name->release,&system_utsname.release,HPUX_UTSLEN-1);
-       error |= __put_user(0,name->release+HPUX_UTSLEN-1);
-       error |= __copy_to_user(&name->version,&system_utsname.version,HPUX_UTSLEN-1);
-       error |= __put_user(0,name->version+HPUX_UTSLEN-1);
-       error |= __copy_to_user(&name->machine,&system_utsname.machine,HPUX_UTSLEN-1);
-       error |= __put_user(0,name->machine+HPUX_UTSLEN-1);
+       error = __copy_to_user(&name->sysname, &utsname()->sysname,
+                              HPUX_UTSLEN - 1);
+       error |= __put_user(0, name->sysname + HPUX_UTSLEN - 1);
+       error |= __copy_to_user(&name->nodename, &utsname()->nodename,
+                               HPUX_UTSLEN - 1);
+       error |= __put_user(0, name->nodename + HPUX_UTSLEN - 1);
+       error |= __copy_to_user(&name->release, &utsname()->release,
+                               HPUX_UTSLEN - 1);
+       error |= __put_user(0, name->release + HPUX_UTSLEN - 1);
+       error |= __copy_to_user(&name->version, &utsname()->version,
+                               HPUX_UTSLEN - 1);
+       error |= __put_user(0, name->version + HPUX_UTSLEN - 1);
+       error |= __copy_to_user(&name->machine, &utsname()->machine,
+                               HPUX_UTSLEN - 1);
+       error |= __put_user(0, name->machine + HPUX_UTSLEN - 1);
 
        up_read(&uts_sem);
 
@@ -373,8 +378,8 @@ int hpux_utssys(char *ubuf, int n, int type)
                /*  TODO:  print a warning about using this?  */
                down_write(&uts_sem);
                error = -EFAULT;
-               if (!copy_from_user(system_utsname.sysname, ubuf, len)) {
-                       system_utsname.sysname[len] = 0;
+               if (!copy_from_user(utsname()->sysname, ubuf, len)) {
+                       utsname()->sysname[len] = 0;
                        error = 0;
                }
                up_write(&uts_sem);
@@ -400,8 +405,8 @@ int hpux_utssys(char *ubuf, int n, int type)
                /*  TODO:  print a warning about this?  */
                down_write(&uts_sem);
                error = -EFAULT;
-               if (!copy_from_user(system_utsname.release, ubuf, len)) {
-                       system_utsname.release[len] = 0;
+               if (!copy_from_user(utsname()->release, ubuf, len)) {
+                       utsname()->release[len] = 0;
                        error = 0;
                }
                up_write(&uts_sem);
@@ -422,13 +427,13 @@ int hpux_getdomainname(char *name, int len)
        
        down_read(&uts_sem);
        
-       nlen = strlen(system_utsname.domainname) + 1;
+       nlen = strlen(utsname()->domainname) + 1;
 
        if (nlen < len)
                len = nlen;
        if(len > __NEW_UTS_LEN)
                goto done;
-       if(copy_to_user(name, system_utsname.domainname, len))
+       if(copy_to_user(name, utsname()->domainname, len))
                goto done;
        err = 0;
 done:
index 9b69d99a910381237791d5e7d0dd9d7c5219aadc..d358866b880f25012aadf35a5e6340dd233ae801 100644 (file)
@@ -260,7 +260,7 @@ long ppc_newuname(struct new_utsname __user * name)
        int err = 0;
 
        down_read(&uts_sem);
-       if (copy_to_user(name, &system_utsname, sizeof(*name)))
+       if (copy_to_user(name, utsname(), sizeof(*name)))
                err = -EFAULT;
        up_read(&uts_sem);
        if (!err)
@@ -273,7 +273,7 @@ int sys_uname(struct old_utsname __user *name)
        int err = 0;
        
        down_read(&uts_sem);
-       if (copy_to_user(name, &system_utsname, sizeof(*name)))
+       if (copy_to_user(name, utsname(), sizeof(*name)))
                err = -EFAULT;
        up_read(&uts_sem);
        if (!err)
@@ -289,19 +289,19 @@ int sys_olduname(struct oldold_utsname __user *name)
                return -EFAULT;
   
        down_read(&uts_sem);
-       error = __copy_to_user(&name->sysname, &system_utsname.sysname,
+       error = __copy_to_user(&name->sysname, &utsname()->sysname,
                               __OLD_UTS_LEN);
        error |= __put_user(0, name->sysname + __OLD_UTS_LEN);
-       error |= __copy_to_user(&name->nodename, &system_utsname.nodename,
+       error |= __copy_to_user(&name->nodename, &utsname()->nodename,
                                __OLD_UTS_LEN);
        error |= __put_user(0, name->nodename + __OLD_UTS_LEN);
-       error |= __copy_to_user(&name->release, &system_utsname.release,
+       error |= __copy_to_user(&name->release, &utsname()->release,
                                __OLD_UTS_LEN);
        error |= __put_user(0, name->release + __OLD_UTS_LEN);
-       error |= __copy_to_user(&name->version, &system_utsname.version,
+       error |= __copy_to_user(&name->version, &utsname()->version,
                                __OLD_UTS_LEN);
        error |= __put_user(0, name->version + __OLD_UTS_LEN);
-       error |= __copy_to_user(&name->machine, &system_utsname.machine,
+       error |= __copy_to_user(&name->machine, &utsname()->machine,
                                __OLD_UTS_LEN);
        error |= override_machine(name->machine);
        up_read(&uts_sem);
index b68ff705f0673c56c1a6845d97569689df136932..11c2acde6eaa9ab9942b8d3cb315eab9d544606d 100644 (file)
@@ -281,7 +281,7 @@ asmlinkage int sys_uname(struct old_utsname * name)
        if (!name)
                return -EFAULT;
        down_read(&uts_sem);
-       err=copy_to_user(name, &system_utsname, sizeof (*name));
+       err = copy_to_user(name, utsname(), sizeof (*name));
        up_read(&uts_sem);
        return err?-EFAULT:0;
 }
index 58ff7d522d81e0181950954f98608d6594bb3bd3..c6de1a95af44115ef29570a3d87fb2d818935d5d 100644 (file)
@@ -279,7 +279,7 @@ asmlinkage int sys_uname(struct old_utsname * name)
        if (!name)
                return -EFAULT;
        down_read(&uts_sem);
-       err=copy_to_user(name, &system_utsname, sizeof (*name));
+       err = copy_to_user(name, utsname(), sizeof (*name));
        up_read(&uts_sem);
        return err?-EFAULT:0;
 }
index 896863fb208a1a3e61f83f60b6f45860c4076115..002ab4dbe5cb990f33618452fc7e12bc2bc3306e 100644 (file)
@@ -475,13 +475,13 @@ asmlinkage int sys_getdomainname(char __user *name, int len)
 
        down_read(&uts_sem);
        
-       nlen = strlen(system_utsname.domainname) + 1;
+       nlen = strlen(utsname()->domainname) + 1;
        err = -EINVAL;
        if (nlen > len)
                goto out;
 
        err = -EFAULT;
-       if (!copy_to_user(name, system_utsname.domainname, nlen))
+       if (!copy_to_user(name, utsname()->domainname, nlen))
                err = 0;
 
 out:
index aa0fb2efb6154241032343e30a748cea59dc5739..9d2cd97d1c3a418885eeb3f9764239225d0b106f 100644 (file)
@@ -483,13 +483,18 @@ asmlinkage int sunos_uname(struct sunos_utsname __user *name)
 {
        int ret;
        down_read(&uts_sem);
-       ret = copy_to_user(&name->sname[0], &system_utsname.sysname[0], sizeof(name->sname) - 1);
+       ret = copy_to_user(&name->sname[0], &utsname()->sysname[0],
+                          sizeof(name->sname) - 1);
        if (!ret) {
-               ret |= __copy_to_user(&name->nname[0], &system_utsname.nodename[0], sizeof(name->nname) - 1);
+               ret |= __copy_to_user(&name->nname[0], &utsname()->nodename[0],
+                                     sizeof(name->nname) - 1);
                ret |= __put_user('\0', &name->nname[8]);
-               ret |= __copy_to_user(&name->rel[0], &system_utsname.release[0], sizeof(name->rel) - 1);
-               ret |= __copy_to_user(&name->ver[0], &system_utsname.version[0], sizeof(name->ver) - 1);
-               ret |= __copy_to_user(&name->mach[0], &system_utsname.machine[0], sizeof(name->mach) - 1);
+               ret |= __copy_to_user(&name->rel[0], &utsname()->release[0],
+                                     sizeof(name->rel) - 1);
+               ret |= __copy_to_user(&name->ver[0], &utsname()->version[0],
+                                     sizeof(name->ver) - 1);
+               ret |= __copy_to_user(&name->mach[0], &utsname()->machine[0],
+                                     sizeof(name->mach) - 1);
        }
        up_read(&uts_sem);
        return ret ? -EFAULT : 0;
index c608c947e6c3dfb125ee6bb75358a7c0049f0ba0..89ac435aacc08ceb34dbf94c80c60f76fa86b230 100644 (file)
@@ -712,13 +712,13 @@ asmlinkage long sys_getdomainname(char __user *name, int len)
 
        down_read(&uts_sem);
        
-       nlen = strlen(system_utsname.domainname) + 1;
+       nlen = strlen(utsname()->domainname) + 1;
        err = -EINVAL;
        if (nlen > len)
                goto out;
 
        err = -EFAULT;
-       if (!copy_to_user(name, system_utsname.domainname, nlen))
+       if (!copy_to_user(name, utsname()->domainname, nlen))
                err = 0;
 
 out:
index 87ebdf858a3a478c1140185e784f5f03964cfe16..953296b73f3f10a49a332413db0203fc090b3e23 100644 (file)
@@ -439,16 +439,16 @@ asmlinkage int sunos_uname(struct sunos_utsname __user *name)
        int ret;
 
        down_read(&uts_sem);
-       ret = copy_to_user(&name->sname[0], &system_utsname.sysname[0],
+       ret = copy_to_user(&name->sname[0], &utsname()->sysname[0],
                           sizeof(name->sname) - 1);
-       ret |= copy_to_user(&name->nname[0], &system_utsname.nodename[0],
+       ret |= copy_to_user(&name->nname[0], &utsname()->nodename[0],
                            sizeof(name->nname) - 1);
        ret |= put_user('\0', &name->nname[8]);
-       ret |= copy_to_user(&name->rel[0], &system_utsname.release[0],
+       ret |= copy_to_user(&name->rel[0], &utsname()->release[0],
                            sizeof(name->rel) - 1);
-       ret |= copy_to_user(&name->ver[0], &system_utsname.version[0],
+       ret |= copy_to_user(&name->ver[0], &utsname()->version[0],
                            sizeof(name->ver) - 1);
-       ret |= copy_to_user(&name->mach[0], &system_utsname.machine[0],
+       ret |= copy_to_user(&name->mach[0], &utsname()->machine[0],
                            sizeof(name->mach) - 1);
        up_read(&uts_sem);
        return (ret ? -EFAULT : 0);
index 9c581328e76a191e3b4aa4903840276db2c3aab2..9ed997982f8dbe245e2f3a15fab1257ee9c10c56 100644 (file)
@@ -249,7 +249,7 @@ asmlinkage int solaris_utssys(u32 buf, u32 flags, int which, u32 buf2)
                /* Let's cheat */
                err  = set_utsfield(v->sysname, "SunOS", 1, 0);
                down_read(&uts_sem);
-               err |= set_utsfield(v->nodename, system_utsname.nodename,
+               err |= set_utsfield(v->nodename, utsname()->nodename,
                                    1, 1);
                up_read(&uts_sem);
                err |= set_utsfield(v->release, "2.6", 0, 0);
@@ -273,7 +273,7 @@ asmlinkage int solaris_utsname(u32 buf)
        /* Why should we not lie a bit? */
        down_read(&uts_sem);
        err  = set_utsfield(v->sysname, "SunOS", 0, 0);
-       err |= set_utsfield(v->nodename, system_utsname.nodename, 1, 1);
+       err |= set_utsfield(v->nodename, utsname()->nodename, 1, 1);
        err |= set_utsfield(v->release, "5.6", 0, 0);
        err |= set_utsfield(v->version, "Generic", 0, 0);
        err |= set_utsfield(v->machine, machine(), 0, 0);
@@ -305,7 +305,7 @@ asmlinkage int solaris_sysinfo(int cmd, u32 buf, s32 count)
        case SI_HOSTNAME:
                r = buffer + 256;
                down_read(&uts_sem);
-               for (p = system_utsname.nodename, q = buffer; 
+               for (p = utsname()->nodename, q = buffer;
                     q < r && *p && *p != '.'; *q++ = *p++);
                up_read(&uts_sem);
                *q = 0;
index 773a134e7fdb806fd6b63c80ceb3576ede57a370..a67dcbd78de4765c7f7f54d7f907cfd01449c2c3 100644 (file)
@@ -106,9 +106,9 @@ void mconsole_version(struct mc_request *req)
 {
        char version[256];
 
-       sprintf(version, "%s %s %s %s %s", system_utsname.sysname,
-               system_utsname.nodename, system_utsname.release,
-               system_utsname.version, system_utsname.machine);
+       sprintf(version, "%s %s %s %s %s", utsname()->sysname,
+               utsname()->nodename, utsname()->release,
+               utsname()->version, utsname()->machine);
        mconsole_reply(req, version, 0, 0);
 }
 
index 48cf88dd02d4daaf94c0aca862065eb9abeb8388..abf14aaf905ffb2fda7789ccbfab5779122f91e8 100644 (file)
@@ -110,7 +110,7 @@ long sys_uname(struct old_utsname __user * name)
        if (!name)
                return -EFAULT;
        down_read(&uts_sem);
-       err = copy_to_user(name, &system_utsname, sizeof (*name));
+       err = copy_to_user(name, utsname(), sizeof (*name));
        up_read(&uts_sem);
        return err?-EFAULT:0;
 }
@@ -126,21 +126,21 @@ long sys_olduname(struct oldold_utsname __user * name)
 
        down_read(&uts_sem);
 
-       error = __copy_to_user(&name->sysname,&system_utsname.sysname,
+       error = __copy_to_user(&name->sysname, &utsname()->sysname,
                               __OLD_UTS_LEN);
-       error |= __put_user(0,name->sysname+__OLD_UTS_LEN);
-       error |= __copy_to_user(&name->nodename,&system_utsname.nodename,
+       error |= __put_user(0, name->sysname + __OLD_UTS_LEN);
+       error |= __copy_to_user(&name->nodename, &utsname()->nodename,
                                __OLD_UTS_LEN);
-       error |= __put_user(0,name->nodename+__OLD_UTS_LEN);
-       error |= __copy_to_user(&name->release,&system_utsname.release,
+       error |= __put_user(0, name->nodename + __OLD_UTS_LEN);
+       error |= __copy_to_user(&name->release, &utsname()->release,
                                __OLD_UTS_LEN);
-       error |= __put_user(0,name->release+__OLD_UTS_LEN);
-       error |= __copy_to_user(&name->version,&system_utsname.version,
+       error |= __put_user(0, name->release + __OLD_UTS_LEN);
+       error |= __copy_to_user(&name->version, &utsname()->version,
                                __OLD_UTS_LEN);
-       error |= __put_user(0,name->version+__OLD_UTS_LEN);
-       error |= __copy_to_user(&name->machine,&system_utsname.machine,
+       error |= __put_user(0, name->version + __OLD_UTS_LEN);
+       error |= __copy_to_user(&name->machine, &utsname()->machine,
                                __OLD_UTS_LEN);
-       error |= __put_user(0,name->machine+__OLD_UTS_LEN);
+       error |= __put_user(0, name->machine + __OLD_UTS_LEN);
 
        up_read(&uts_sem);
 
index 6fce9f45dfdc0257aafafaf543afffcfc42127e3..73ce4463f70c6f96b2cd94f000b69df5a0da95ff 100644 (file)
@@ -21,7 +21,7 @@ asmlinkage long sys_uname64(struct new_utsname __user * name)
 {
        int err;
        down_read(&uts_sem);
-       err = copy_to_user(name, &system_utsname, sizeof (*name));
+       err = copy_to_user(name, utsname(), sizeof (*name));
        up_read(&uts_sem);
        if (personality(current->personality) == PER_LINUX32)
                err |= copy_to_user(&name->machine, "i686", 5);
index f280d3665f4bed8fa07513078f39113369814354..26a01717cc1a449703894bcc8154071d05ecc860 100644 (file)
@@ -784,36 +784,36 @@ asmlinkage long sys32_olduname(struct oldold_utsname __user * name)
 
        if (!name)
                return -EFAULT;
-       if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
+       if (!access_ok(VERIFY_WRITE, name, sizeof(struct oldold_utsname)))
                return -EFAULT;
   
        down_read(&uts_sem);
-       
-       err = __copy_to_user(&name->sysname,&system_utsname.sysname,
+
+       err = __copy_to_user(&name->sysname,&utsname()->sysname,
                                __OLD_UTS_LEN);
        err |= __put_user(0,name->sysname+__OLD_UTS_LEN);
-       err |= __copy_to_user(&name->nodename,&system_utsname.nodename,
+       err |= __copy_to_user(&name->nodename,&utsname()->nodename,
                                __OLD_UTS_LEN);
        err |= __put_user(0,name->nodename+__OLD_UTS_LEN);
-       err |= __copy_to_user(&name->release,&system_utsname.release,
+       err |= __copy_to_user(&name->release,&utsname()->release,
                                __OLD_UTS_LEN);
        err |= __put_user(0,name->release+__OLD_UTS_LEN);
-       err |= __copy_to_user(&name->version,&system_utsname.version,
+       err |= __copy_to_user(&name->version,&utsname()->version,
                                __OLD_UTS_LEN);
        err |= __put_user(0,name->version+__OLD_UTS_LEN);
-        { 
-                char *arch = "x86_64";
-                if (personality(current->personality) == PER_LINUX32)
-                        arch = "i686";
+       {
+               char *arch = "x86_64";
+               if (personality(current->personality) == PER_LINUX32)
+                       arch = "i686";
                 
-                err |= __copy_to_user(&name->machine,arch,strlen(arch)+1);
-        }
-       
-        up_read(&uts_sem);
-        
-        err = err ? -EFAULT : 0;
-        
-        return err;
+               err |= __copy_to_user(&name->machine, arch, strlen(arch)+1);
+       }
+
+       up_read(&uts_sem);
+
+       err = err ? -EFAULT : 0;
+
+       return err;
 }
 
 long sys32_uname(struct old_utsname __user * name)
@@ -822,7 +822,7 @@ long sys32_uname(struct old_utsname __user * name)
        if (!name)
                return -EFAULT;
        down_read(&uts_sem);
-       err=copy_to_user(name, &system_utsname, sizeof (*name));
+       err = copy_to_user(name, utsname(), sizeof (*name));
        up_read(&uts_sem);
        if (personality(current->personality) == PER_LINUX32) 
                err |= copy_to_user(&name->machine, "i686", 5);
index 6449ea8fe756475b7316bdaa51ddd16e3c2c6dd9..76bf7c241fe410fdd676b17c6bce41143293a883 100644 (file)
@@ -148,7 +148,7 @@ asmlinkage long sys_uname(struct new_utsname __user * name)
 {
        int err;
        down_read(&uts_sem);
-       err = copy_to_user(name, &system_utsname, sizeof (*name));
+       err = copy_to_user(name, utsname(), sizeof (*name));
        up_read(&uts_sem);
        if (personality(current->personality) == PER_LINUX32) 
                err |= copy_to_user(&name->machine, "i686", 5);                 
index 4688ba2db84d5c46c8ae060bec50fe891454bf4b..37c90ca5b98df35d3201f2c3fa9d3d3628d55097 100644 (file)
@@ -128,7 +128,7 @@ out:
 
 int sys_uname(struct old_utsname * name)
 {
-       if (name && !copy_to_user(name, &system_utsname, sizeof (*name)))
+       if (name && !copy_to_user(name, utsname(), sizeof (*name)))
                return 0;
        return -EFAULT;
 }
index b430a12eb8190d9266ccd0de322c243021a1086e..07f47a0208a7200b4e0ba1f32bd747d82ae1db6b 100644 (file)
@@ -889,8 +889,8 @@ static void init_std_data(struct entropy_store *r)
 
        do_gettimeofday(&tv);
        add_entropy_words(r, (__u32 *)&tv, sizeof(tv)/4);
-       add_entropy_words(r, (__u32 *)&system_utsname,
-                         sizeof(system_utsname)/4);
+       add_entropy_words(r, (__u32 *)utsname(),
+                         sizeof(*(utsname()))/4);
 }
 
 static int __init rand_initialize(void)
index 0e9ba0b9d71eb008138eab55841bffe5d73be196..c78762051da4e5b15da45fa06b46b66d85e55d82 100644 (file)
@@ -772,12 +772,12 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol)
        separator[1] = 0; 
 
        memset(vol->source_rfc1001_name,0x20,15);
-       for(i=0;i < strnlen(system_utsname.nodename,15);i++) {
+       for(i=0;i < strnlen(utsname()->nodename,15);i++) {
                /* does not have to be a perfect mapping since the field is
                informational, only used for servers that do not support
                port 445 and it can be overridden at mount time */
                vol->source_rfc1001_name[i] = 
-                       toupper(system_utsname.nodename[i]);
+                       toupper(utsname()->nodename[i]);
        }
        vol->source_rfc1001_name[15] = 0;
        /* null target name indicates to use *SMBSERVR default called name
@@ -2153,7 +2153,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
                                  32, nls_codepage);
                bcc_ptr += 2 * bytes_returned;
                bytes_returned =
-                   cifs_strtoUCS((__le16 *) bcc_ptr, system_utsname.release,
+                   cifs_strtoUCS((__le16 *) bcc_ptr, utsname()->release,
                                  32, nls_codepage);
                bcc_ptr += 2 * bytes_returned;
                bcc_ptr += 2;
@@ -2180,8 +2180,8 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
                }
                strcpy(bcc_ptr, "Linux version ");
                bcc_ptr += strlen("Linux version ");
-               strcpy(bcc_ptr, system_utsname.release);
-               bcc_ptr += strlen(system_utsname.release) + 1;
+               strcpy(bcc_ptr, utsname()->release);
+               bcc_ptr += strlen(utsname()->release) + 1;
                strcpy(bcc_ptr, CIFS_NETWORK_OPSYS);
                bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1;
        }
@@ -2445,7 +2445,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
                                  32, nls_codepage);
                bcc_ptr += 2 * bytes_returned;
                bytes_returned =
-                   cifs_strtoUCS((__le16 *) bcc_ptr, system_utsname.release, 32,
+                   cifs_strtoUCS((__le16 *) bcc_ptr, utsname()->release, 32,
                                  nls_codepage);
                bcc_ptr += 2 * bytes_returned;
                bcc_ptr += 2;   /* null terminate Linux version */
@@ -2462,8 +2462,8 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
        } else {                /* ASCII */
                strcpy(bcc_ptr, "Linux version ");
                bcc_ptr += strlen("Linux version ");
-               strcpy(bcc_ptr, system_utsname.release);
-               bcc_ptr += strlen(system_utsname.release) + 1;
+               strcpy(bcc_ptr, utsname()->release);
+               bcc_ptr += strlen(utsname()->release) + 1;
                strcpy(bcc_ptr, CIFS_NETWORK_OPSYS);
                bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1;
                bcc_ptr++;      /* empty domain field */
@@ -2836,7 +2836,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
                                  32, nls_codepage);
                bcc_ptr += 2 * bytes_returned;
                bytes_returned =
-                   cifs_strtoUCS((__le16 *) bcc_ptr, system_utsname.release, 32,
+                   cifs_strtoUCS((__le16 *) bcc_ptr, utsname()->release, 32,
                                  nls_codepage);
                bcc_ptr += 2 * bytes_returned;
                bcc_ptr += 2;   /* null term version string */
@@ -2888,8 +2888,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
 
                strcpy(bcc_ptr, "Linux version ");
                bcc_ptr += strlen("Linux version ");
-               strcpy(bcc_ptr, system_utsname.release);
-               bcc_ptr += strlen(system_utsname.release) + 1;
+               strcpy(bcc_ptr, utsname()->release);
+               bcc_ptr += strlen(utsname()->release) + 1;
                strcpy(bcc_ptr, CIFS_NETWORK_OPSYS);
                bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1;
                bcc_ptr++;      /* null domain */
index 6270f8f20a638195b1e1c1fc59bba00d8f4d2bd3..d993ea1a81aee7b60cdc11ffc9ee18dd09a8658d 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1318,7 +1318,7 @@ static void format_corename(char *corename, const char *pattern, long signr)
                        case 'h':
                                down_read(&uts_sem);
                                rc = snprintf(out_ptr, out_end - out_ptr,
-                                             "%s", system_utsname.nodename);
+                                             "%s", utsname()->nodename);
                                up_read(&uts_sem);
                                if (rc > out_end - out_ptr)
                                        goto out;
index 271e2165fff6ebf8577f4f5ab590a911ec9bedfe..0116729cec5f717ed246715e813108e7b12cb6b7 100644 (file)
@@ -129,11 +129,11 @@ static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl)
        nlmclnt_next_cookie(&argp->cookie);
        argp->state   = nsm_local_state;
        memcpy(&lock->fh, NFS_FH(fl->fl_file->f_dentry->d_inode), sizeof(struct nfs_fh));
-       lock->caller  = system_utsname.nodename;
+       lock->caller  = utsname()->nodename;
        lock->oh.data = req->a_owner;
        lock->oh.len  = snprintf(req->a_owner, sizeof(req->a_owner), "%u@%s",
                                (unsigned int)fl->fl_u.nfs_fl.owner->pid,
-                               system_utsname.nodename);
+                               utsname()->nodename);
        lock->svid = fl->fl_u.nfs_fl.owner->pid;
        lock->fl.fl_start = fl->fl_start;
        lock->fl.fl_end = fl->fl_end;
index 5954dcb497e4e43b241ba48d6cab7f6b1453e307..a816b920d431fcfd60fc806b10bd4e0cc25c02f7 100644 (file)
@@ -145,7 +145,7 @@ xdr_encode_common(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
         */
        sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(argp->addr));
        if (!(p = xdr_encode_string(p, buffer))
-        || !(p = xdr_encode_string(p, system_utsname.nodename)))
+        || !(p = xdr_encode_string(p, utsname()->nodename)))
                return ERR_PTR(-EIO);
        *p++ = htonl(argp->prog);
        *p++ = htonl(argp->vers);
index c9d419703cf30b35daa6fcf17609b948f465b4a0..93c00ee7189d739f07f60ddf119cc719a4ce4146 100644 (file)
@@ -325,7 +325,7 @@ static int nlmsvc_setgrantargs(struct nlm_rqst *call, struct nlm_lock *lock)
 {
        locks_copy_lock(&call->a_args.lock.fl, &lock->fl);
        memcpy(&call->a_args.lock.fh, &lock->fh, sizeof(call->a_args.lock.fh));
-       call->a_args.lock.caller = system_utsname.nodename;
+       call->a_args.lock.caller = utsname()->nodename;
        call->a_args.lock.oh.len = lock->oh.len;
 
        /* set default data area */
index 033ea4ac2c30be2590f36103d9f2f1fe4dd7023a..61c46facf257413f21ca462a9466e402265df906 100644 (file)
@@ -515,7 +515,7 @@ nlmclt_decode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
  */
 #define NLM_void_sz            0
 #define NLM_cookie_sz          1+XDR_QUADLEN(NLM_MAXCOOKIELEN)
-#define NLM_caller_sz          1+XDR_QUADLEN(sizeof(system_utsname.nodename))
+#define NLM_caller_sz          1+XDR_QUADLEN(sizeof(utsname()->nodename))
 #define NLM_netobj_sz          1+XDR_QUADLEN(XDR_MAX_NETOBJ)
 /* #define NLM_owner_sz                1+XDR_QUADLEN(NLM_MAXOWNER) */
 #define NLM_fhandle_sz         1+XDR_QUADLEN(NFS2_FHSIZE)
index c0a754ecdee66447464a9bb67c900071896909a3..1d656a64519977189d7741e944dd11832e6e51ae 100644 (file)
@@ -312,7 +312,7 @@ static int __init root_nfs_name(char *name)
        /* Override them by options set on kernel command-line */
        root_nfs_parse(name, buf);
 
-       cp = system_utsname.nodename;
+       cp = utsname()->nodename;
        if (strlen(buf) + strlen(cp) > NFS_MAXPATHLEN) {
                printk(KERN_ERR "Root-NFS: Pathname for remote directory too long.\n");
                return -1;
index db4344d9f73f52fe716076b7f3704a0455f747ae..3a05436f31c0e8252e01389f251d7d5225711583 100644 (file)
@@ -112,7 +112,7 @@ typedef struct user_fxsr_struct elf_fpxregset_t;
    For the moment, we have only optimizations for the Intel generations,
    but that could change... */
 
-#define ELF_PLATFORM  (system_utsname.machine)
+#define ELF_PLATFORM  (utsname()->machine)
 
 #define SET_PERSONALITY(ex, ibcs2) do { } while (0)
 
index 0d92c468d55aeeb1f4b83e5847ef3bc5c529b2b7..47b7dbd647a63efa5e6c84b872231dc194d2c211 100644 (file)
@@ -80,7 +80,7 @@ struct nlm_wait;
 /*
  * Memory chunk for NLM client RPC request.
  */
-#define NLMCLNT_OHSIZE         (sizeof(system_utsname.nodename)+10)
+#define NLMCLNT_OHSIZE         (sizeof(utsname()->nodename)+10)
 struct nlm_rqst {
        unsigned int            a_flags;        /* initial RPC task flags */
        struct nlm_host *       a_host;         /* host handle */
index 398d57923f951d43133ea9e7d3e929c477e68069..3a4776e8f16e3df1488d359a806bbccacdd19780 100644 (file)
@@ -1655,7 +1655,7 @@ asmlinkage long sys_newuname(struct new_utsname __user * name)
        int errno = 0;
 
        down_read(&uts_sem);
-       if (copy_to_user(name,&system_utsname,sizeof *name))
+       if (copy_to_user(name, utsname(), sizeof *name))
                errno = -EFAULT;
        up_read(&uts_sem);
        return errno;
@@ -1673,8 +1673,8 @@ asmlinkage long sys_sethostname(char __user *name, int len)
        down_write(&uts_sem);
        errno = -EFAULT;
        if (!copy_from_user(tmp, name, len)) {
-               memcpy(system_utsname.nodename, tmp, len);
-               system_utsname.nodename[len] = 0;
+               memcpy(utsname()->nodename, tmp, len);
+               utsname()->nodename[len] = 0;
                errno = 0;
        }
        up_write(&uts_sem);
@@ -1690,11 +1690,11 @@ asmlinkage long sys_gethostname(char __user *name, int len)
        if (len < 0)
                return -EINVAL;
        down_read(&uts_sem);
-       i = 1 + strlen(system_utsname.nodename);
+       i = 1 + strlen(utsname()->nodename);
        if (i > len)
                i = len;
        errno = 0;
-       if (copy_to_user(name, system_utsname.nodename, i))
+       if (copy_to_user(name, utsname()->nodename, i))
                errno = -EFAULT;
        up_read(&uts_sem);
        return errno;
@@ -1719,8 +1719,8 @@ asmlinkage long sys_setdomainname(char __user *name, int len)
        down_write(&uts_sem);
        errno = -EFAULT;
        if (!copy_from_user(tmp, name, len)) {
-               memcpy(system_utsname.domainname, tmp, len);
-               system_utsname.domainname[len] = 0;
+               memcpy(utsname()->domainname, tmp, len);
+               utsname()->domainname[len] = 0;
                errno = 0;
        }
        up_write(&uts_sem);
index 1fbb38415b193e66f487a5eb8aef1738df866661..99d50065aa7904813ed2351da0d3651bdb5f7f83 100644 (file)
@@ -805,7 +805,7 @@ static void __init ic_do_bootp_ext(u8 *ext)
                        }
                        break;
                case 12:        /* Host name */
-                       ic_bootp_string(system_utsname.nodename, ext+1, *ext, __NEW_UTS_LEN);
+                       ic_bootp_string(utsname()->nodename, ext+1, *ext, __NEW_UTS_LEN);
                        ic_host_name_set = 1;
                        break;
                case 15:        /* Domain name (DNS) */
@@ -816,7 +816,7 @@ static void __init ic_do_bootp_ext(u8 *ext)
                                ic_bootp_string(root_server_path, ext+1, *ext, sizeof(root_server_path));
                        break;
                case 40:        /* NIS Domain name (_not_ DNS) */
-                       ic_bootp_string(system_utsname.domainname, ext+1, *ext, __NEW_UTS_LEN);
+                       ic_bootp_string(utsname()->domainname, ext+1, *ext, __NEW_UTS_LEN);
                        break;
        }
 }
@@ -1368,7 +1368,7 @@ static int __init ip_auto_config(void)
        printk(", mask=%u.%u.%u.%u", NIPQUAD(ic_netmask));
        printk(", gw=%u.%u.%u.%u", NIPQUAD(ic_gateway));
        printk(",\n     host=%s, domain=%s, nis-domain=%s",
-              system_utsname.nodename, ic_domain, system_utsname.domainname);
+              utsname()->nodename, ic_domain, utsname()->domainname);
        printk(",\n     bootserver=%u.%u.%u.%u", NIPQUAD(ic_servaddr));
        printk(", rootserver=%u.%u.%u.%u", NIPQUAD(root_server_addr));
        printk(", rootpath=%s", root_server_path);
@@ -1478,11 +1478,11 @@ static int __init ip_auto_config_setup(char *addrs)
                        case 4:
                                if ((dp = strchr(ip, '.'))) {
                                        *dp++ = '\0';
-                                       strlcpy(system_utsname.domainname, dp,
-                                               sizeof(system_utsname.domainname));
+                                       strlcpy(utsname()->domainname, dp,
+                                               sizeof(utsname()->domainname));
                                }
-                               strlcpy(system_utsname.nodename, ip,
-                                       sizeof(system_utsname.nodename));
+                               strlcpy(utsname()->nodename, ip,
+                                       sizeof(utsname()->nodename));
                                ic_host_name_set = 1;
                                break;
                        case 5:
index 124ff0ceb55b2ee20ce47d6f3358a966de37ddb5..78696f2dc7d6d402ef200f140f897388ce383db1 100644 (file)
@@ -161,10 +161,10 @@ static struct rpc_clnt * rpc_new_client(struct rpc_xprt *xprt, char *servname, s
        }
 
        /* save the nodename */
-       clnt->cl_nodelen = strlen(system_utsname.nodename);
+       clnt->cl_nodelen = strlen(utsname()->nodename);
        if (clnt->cl_nodelen > UNX_MAXNODENAME)
                clnt->cl_nodelen = UNX_MAXNODENAME;
-       memcpy(clnt->cl_nodename, system_utsname.nodename, clnt->cl_nodelen);
+       memcpy(clnt->cl_nodename, utsname()->nodename, clnt->cl_nodelen);
        return clnt;
 
 out_no_auth: