* Copyright (c) 1982, 1986, 1989 Regents of the University of California.
* %sccs.include.redist.c%
* @(#)kern_xxx.c 7.20 (Berkeley) %G%
char hostname
[MAXHOSTNAMELEN
];
gethostid(p
, uap
, retval
)
struct gethostid_args
*uap
;
*(long *)retval
= hostid
;
sethostid(p
, uap
, retval
)
struct sethostid_args
*uap
;
struct gethostname_args
{
gethostname(p
, uap
, retval
)
struct gethostname_args
*uap
;
if (uap
->len
> hostnamelen
+ 1)
uap
->len
= hostnamelen
+ 1;
return (copyout((caddr_t
)hostname
, (caddr_t
)uap
->hostname
, uap
->len
));
struct sethostname_args
{
sethostname(p
, uap
, retval
)
register struct sethostname_args
*uap
;
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;