Commit | Line | Data |
---|---|---|
da7c5cc6 | 1 | /* |
c34daa85 KB |
2 | * Copyright (c) 1982, 1986, 1989, 1993 |
3 | * The Regents of the University of California. All rights reserved. | |
da7c5cc6 | 4 | * |
dbf0c423 | 5 | * %sccs.include.redist.c% |
ffa9c2af | 6 | * |
22d88556 | 7 | * @(#)kern_xxx.c 8.2 (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> | |
e7d26b7c | 15 | #include <vm/vm.h> |
02549ed8 | 16 | #include <sys/sysctl.h> |
3dbbffbd | 17 | |
02549ed8 KM |
18 | struct reboot_args { |
19 | int opt; | |
20 | }; | |
21 | /* ARGSUSED */ | |
22 | reboot(p, uap, retval) | |
23 | struct proc *p; | |
24 | struct reboot_args *uap; | |
25 | int *retval; | |
26 | { | |
27 | int error; | |
28 | ||
29 | if (error = suser(p->p_ucred, &p->p_acflag)) | |
30 | return (error); | |
31 | boot(uap->opt); | |
32 | return (0); | |
33 | } | |
34 | ||
0305ab3e | 35 | #if defined(COMPAT_43) || defined(COMPAT_SUNOS) |
3dbbffbd | 36 | |
9e97623a CT |
37 | struct gethostname_args { |
38 | char *hostname; | |
39 | u_int len; | |
40 | }; | |
fc4a5eac | 41 | /* ARGSUSED */ |
265542db | 42 | ogethostname(p, uap, retval) |
fc4a5eac | 43 | struct proc *p; |
9e97623a | 44 | struct gethostname_args *uap; |
fc4a5eac MK |
45 | int *retval; |
46 | { | |
02549ed8 | 47 | int name; |
3dbbffbd | 48 | |
02549ed8 KM |
49 | name = KERN_HOSTNAME; |
50 | return (kern_sysctl(&name, 1, uap->hostname, &uap->len, 0, 0)); | |
3dbbffbd SL |
51 | } |
52 | ||
9e97623a CT |
53 | struct sethostname_args { |
54 | char *hostname; | |
55 | u_int len; | |
56 | }; | |
fc4a5eac | 57 | /* ARGSUSED */ |
265542db | 58 | osethostname(p, uap, retval) |
fc4a5eac | 59 | struct proc *p; |
9e97623a | 60 | register struct sethostname_args *uap; |
fc4a5eac MK |
61 | int *retval; |
62 | { | |
02549ed8 | 63 | int name; |
22d88556 | 64 | int error; |
3dbbffbd | 65 | |
22d88556 MH |
66 | if (error = suser(p->p_ucred, &p->p_acflag)) |
67 | return (error); | |
02549ed8 KM |
68 | name = KERN_HOSTNAME; |
69 | return (kern_sysctl(&name, 1, 0, 0, uap->hostname, uap->len)); | |
3dbbffbd SL |
70 | } |
71 | ||
0305ab3e CT |
72 | extern long hostid; |
73 | ||
74 | struct gethostid_args { | |
75 | int dummy; | |
76 | }; | |
77 | /* ARGSUSED */ | |
78 | ogethostid(p, uap, retval) | |
79 | struct proc *p; | |
80 | struct gethostid_args *uap; | |
81 | int *retval; | |
82 | { | |
83 | ||
84 | *(long *)retval = hostid; | |
85 | return (0); | |
86 | } | |
87 | #endif /* COMPAT_43 || COMPAT_SUNOS */ | |
88 | ||
89 | #ifdef COMPAT_43 | |
90 | struct sethostid_args { | |
91 | long hostid; | |
92 | }; | |
93 | /* ARGSUSED */ | |
94 | osethostid(p, uap, retval) | |
95 | struct proc *p; | |
96 | struct sethostid_args *uap; | |
97 | int *retval; | |
98 | { | |
99 | int error; | |
100 | ||
101 | } | |
102 | ||
16688d3b | 103 | oquota() |
a2d8720f | 104 | { |
d86b717b | 105 | |
16688d3b | 106 | return (ENOSYS); |
004e44d8 | 107 | } |
02549ed8 | 108 | #endif /* COMPAT_43 */ |