summaryrefslogtreecommitdiffstats
path: root/sys/compat/svr4
diff options
context:
space:
mode:
authorjamie <jamie@FreeBSD.org>2009-06-13 00:12:02 +0000
committerjamie <jamie@FreeBSD.org>2009-06-13 00:12:02 +0000
commite9da16507b21a78c2b02b2cad1b54a52717a4870 (patch)
tree5fa814cc5d5238c1add8188657ed64527aeae8b6 /sys/compat/svr4
parent79af22e74c6d99535ff7919ffdb68531c9835bb9 (diff)
downloadFreeBSD-src-e9da16507b21a78c2b02b2cad1b54a52717a4870.zip
FreeBSD-src-e9da16507b21a78c2b02b2cad1b54a52717a4870.tar.gz
Add counterparts to getcredhostname:
getcreddomainname, getcredhostuuid, getcredhostid Suggested by: rmacklem Approved by: bz
Diffstat (limited to 'sys/compat/svr4')
-rw-r--r--sys/compat/svr4/svr4_stat.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/compat/svr4/svr4_stat.c b/sys/compat/svr4/svr4_stat.c
index 415faa0..9ef94be 100644
--- a/sys/compat/svr4/svr4_stat.c
+++ b/sys/compat/svr4/svr4_stat.c
@@ -411,10 +411,10 @@ svr4_sys_systeminfo(td, uap)
struct thread *td;
struct svr4_sys_systeminfo_args *uap;
{
- struct prison *pr;
char *str = NULL;
int error = 0;
register_t *retval = td->td_retval;
+ u_long hostid;
size_t len = 0;
char buf[MAXHOSTNAMELEN];
u_int rlen = uap->len;
@@ -458,10 +458,8 @@ svr4_sys_systeminfo(td, uap)
break;
case SVR4_SI_HW_SERIAL:
- pr = td->td_ucred->cr_prison;
- mtx_lock(&pr->pr_mtx);
- snprintf(buf, sizeof(buf), "%lu", pr->pr_hostid);
- mtx_unlock(&pr->pr_mtx);
+ getcredhostid(td->td_ucred, &hostid);
+ snprintf(buf, sizeof(buf), "%lu", hostid);
str = buf;
break;
@@ -470,10 +468,7 @@ svr4_sys_systeminfo(td, uap)
break;
case SVR4_SI_SRPC_DOMAIN:
- pr = td->td_ucred->cr_prison;
- mtx_lock(&pr->pr_mtx);
- strlcpy(buf, pr->pr_domain, sizeof(buf));
- mtx_unlock(&pr->pr_mtx);
+ getcreddomainname(td->td_ucred, buf, sizeof(buf));
str = buf;
break;
OpenPOWER on IntegriCloud