* Copyright (c) 1982, 1986, 1989 Regents of the University of California.
* %sccs.include.redist.c%
* @(#)kern_xxx.c 7.18 (Berkeley) %G%
char hostname
[MAXHOSTNAMELEN
];
gethostid(p
, uap
, retval
)
sethostid(p
, uap
, retval
)
gethostname(p
, uap
, retval
)
if (uap
->len
> hostnamelen
+ 1)
uap
->len
= hostnamelen
+ 1;
return (copyout((caddr_t
)hostname
, (caddr_t
)uap
->hostname
, uap
->len
));
sethostname(p
, uap
, retval
)
if (error
= suser(p
->p_ucred
, &p
->p_acflag
))
if (uap
->len
> sizeof (hostname
) - 1)
error
= copyin((caddr_t
)uap
->hostname
, hostname
, uap
->len
);
hostname
[hostnamelen
] = 0;