SunOS compat needs get/set host name/id too
[unix-history] / usr / src / sys / kern / kern_xxx.c
CommitLineData
da7c5cc6 1/*
ffa9c2af
KM
2 * Copyright (c) 1982, 1986, 1989 Regents of the University of California.
3 * All rights reserved.
da7c5cc6 4 *
dbf0c423 5 * %sccs.include.redist.c%
ffa9c2af 6 *
43b935eb 7 * @(#)kern_xxx.c 7.23 (Berkeley) %G%
da7c5cc6 8 */
3dbbffbd 9
38a01dbe
KB
10#include <sys/param.h>
11#include <sys/systm.h>
12#include <sys/kernel.h>
13#include <sys/proc.h>
14#include <sys/reboot.h>
02549ed8 15#include <sys/sysctl.h>
3dbbffbd 16
02549ed8
KM
17struct reboot_args {
18 int opt;
19};
20/* ARGSUSED */
21reboot(p, uap, retval)
22 struct proc *p;
23 struct reboot_args *uap;
24 int *retval;
25{
26 int error;
27
28 if (error = suser(p->p_ucred, &p->p_acflag))
29 return (error);
30 boot(uap->opt);
31 return (0);
32}
33
34#ifdef COMPAT_43
35
36extern long hostid;
e686384a 37
9e97623a
CT
38struct gethostid_args {
39 int dummy;
40};
fc4a5eac 41/* ARGSUSED */
265542db 42ogethostid(p, uap, retval)
fc4a5eac 43 struct proc *p;
9e97623a
CT
44 struct gethostid_args *uap;
45 int *retval;
3dbbffbd
SL
46{
47
9e97623a 48 *(long *)retval = hostid;
d9c2f47f 49 return (0);
3dbbffbd
SL
50}
51
9e97623a
CT
52struct sethostid_args {
53 long hostid;
54};
6d4441aa 55/* ARGSUSED */
265542db 56osethostid(p, uap, retval)
fc4a5eac 57 struct proc *p;
9e97623a 58 struct sethostid_args *uap;
fc4a5eac
MK
59 int *retval;
60{
d86b717b 61 int error;
3dbbffbd 62
3dbbffbd
SL
63}
64
9e97623a
CT
65struct gethostname_args {
66 char *hostname;
67 u_int len;
68};
fc4a5eac 69/* ARGSUSED */
265542db 70ogethostname(p, uap, retval)
fc4a5eac 71 struct proc *p;
9e97623a 72 struct gethostname_args *uap;
fc4a5eac
MK
73 int *retval;
74{
02549ed8 75 int name;
3dbbffbd 76
02549ed8
KM
77 name = KERN_HOSTNAME;
78 return (kern_sysctl(&name, 1, uap->hostname, &uap->len, 0, 0));
3dbbffbd
SL
79}
80
9e97623a
CT
81struct sethostname_args {
82 char *hostname;
83 u_int len;
84};
fc4a5eac 85/* ARGSUSED */
265542db 86osethostname(p, uap, retval)
fc4a5eac 87 struct proc *p;
9e97623a 88 register struct sethostname_args *uap;
fc4a5eac
MK
89 int *retval;
90{
02549ed8 91 int name;
3dbbffbd 92
02549ed8
KM
93 name = KERN_HOSTNAME;
94 return (kern_sysctl(&name, 1, 0, 0, uap->hostname, uap->len));
3dbbffbd
SL
95}
96
16688d3b 97oquota()
a2d8720f 98{
d86b717b 99
16688d3b 100 return (ENOSYS);
004e44d8 101}
02549ed8 102#endif /* COMPAT_43 */