more-or-less working with new proc & user structs
[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 *
8429d022 7 * @(#)kern_xxx.c 7.16 (Berkeley) %G%
da7c5cc6 8 */
3dbbffbd 9
94368568
JB
10#include "param.h"
11#include "systm.h"
d9c2f47f 12#include "user.h"
94368568
JB
13#include "kernel.h"
14#include "proc.h"
15#include "reboot.h"
3dbbffbd 16
fc4a5eac
MK
17/* ARGSUSED */
18gethostid(p, uap, retval)
19 struct proc *p;
20 void *uap;
21 long *retval;
3dbbffbd
SL
22{
23
fc4a5eac 24 *retval = hostid;
d9c2f47f 25 return (0);
3dbbffbd
SL
26}
27
6d4441aa 28/* ARGSUSED */
fc4a5eac
MK
29sethostid(p, uap, retval)
30 struct proc *p;
31 struct args {
c916bcc9 32 long hostid;
fc4a5eac
MK
33 } *uap;
34 int *retval;
35{
d86b717b 36 int error;
3dbbffbd 37
3dbbffbd
SL
38}
39
fc4a5eac
MK
40/* ARGSUSED */
41gethostname(p, uap, retval)
42 struct proc *p;
43 struct args {
3dbbffbd 44 char *hostname;
31286ce2 45 u_int len;
fc4a5eac
MK
46 } *uap;
47 int *retval;
48{
3dbbffbd 49
641529c8
MT
50 if (uap->len > hostnamelen + 1)
51 uap->len = hostnamelen + 1;
d9c2f47f 52 return (copyout((caddr_t)hostname, (caddr_t)uap->hostname, uap->len));
3dbbffbd
SL
53}
54
fc4a5eac
MK
55/* ARGSUSED */
56sethostname(p, uap, retval)
57 struct proc *p;
58 register struct args {
3dbbffbd
SL
59 char *hostname;
60 u_int len;
fc4a5eac
MK
61 } *uap;
62 int *retval;
63{
d86b717b 64 int error;
3dbbffbd 65
8429d022 66 if (error = suser(p->p_ucred, &p->p_acflag))
d9c2f47f 67 return (error);
d86b717b 68 if (uap->len > sizeof (hostname) - 1)
d9c2f47f 69 return (EINVAL);
3dbbffbd 70 hostnamelen = uap->len;
d86b717b 71 error = copyin((caddr_t)uap->hostname, hostname, uap->len);
3dbbffbd 72 hostname[hostnamelen] = 0;
d9c2f47f 73 return (error);
3dbbffbd
SL
74}
75
fc4a5eac
MK
76/* ARGSUSED */
77reboot(p, uap, retval)
78 struct proc *p;
79 struct args {
3dbbffbd 80 int opt;
fc4a5eac
MK
81 } *uap;
82 int *retval;
83{
d86b717b 84 int error;
3dbbffbd 85
3dbbffbd 86}
a2d8720f
MT
87
88ovhangup()
89{
d86b717b 90
d9c2f47f 91 return (EINVAL);
a2d8720f 92}
004e44d8
KM
93
94oldquota()
95{
96
d9c2f47f 97 return (EINVAL);
004e44d8 98}