SCCS-vsn: usr.bin/w/w.c 5.34
SCCS-vsn: lib/libc/gmon/gmon.c 5.13
SCCS-vsn: usr.bin/fstat/fstat.c 5.43
*/
#if !defined(lint) && defined(LIBC_SCCS)
*/
#if !defined(lint) && defined(LIBC_SCCS)
-static char sccsid[] = "@(#)gmon.c 5.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)gmon.c 5.13 (Berkeley) %G%";
#endif
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#endif
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#ifdef DEBUG
#include <stdio.h>
#ifdef DEBUG
#include <stdio.h>
{
register int o;
struct clockinfo clockinfo;
{
register int o;
struct clockinfo clockinfo;
- int tsize, fsize, size;
+ int mib[2], tsize, fsize, size;
char *cp;
struct gmonhdr *hdr;
struct gmonparam *p = &_gmonparam;
char *cp;
struct gmonhdr *hdr;
struct gmonparam *p = &_gmonparam;
moncontrol(1);
size = sizeof(clockinfo);
moncontrol(1);
size = sizeof(clockinfo);
- if (getkerninfo(KINFO_CLOCKRATE, &clockinfo, &size, 0) < 0)
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_CLOCKRATE;
+ if (sysctl(mib, 2, &clockinfo, &size, NULL, 0) < 0)
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)fstat.c 5.42 (Berkeley) %G%";
+static char sccsid[] = "@(#)fstat.c 5.43 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
#include <sys/domain.h>
#include <sys/protosw.h>
#include <sys/unpcb.h>
#include <sys/domain.h>
#include <sys/protosw.h>
#include <sys/unpcb.h>
#include <sys/kinfo_proc.h>
#include <sys/filedesc.h>
#define KERNEL
#include <sys/kinfo_proc.h>
#include <sys/filedesc.h>
#define KERNEL
nlistf = memf = NULL;
while ((ch = getopt(argc, argv, "fnp:u:vNM")) != EOF)
switch((char)ch) {
nlistf = memf = NULL;
while ((ch = getopt(argc, argv, "fnp:u:vNM")) != EOF)
switch((char)ch) {
"fstat: -p requires a process id\n");
usage();
}
"fstat: -p requires a process id\n");
usage();
}
arg = atoi(optarg);
break;
case 'u':
arg = atoi(optarg);
break;
case 'u':
arg = passwd->pw_uid;
break;
case 'v':
arg = passwd->pw_uid;
break;
case 'v':
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)w.c 5.33 (Berkeley) %G%";
+static char sccsid[] = "@(#)w.c 5.34 (Berkeley) %G%";
#endif /* not lint */
#define ADDRHACK
#endif /* not lint */
#define ADDRHACK
#include <sys/file.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/file.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/ioctl.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/ioctl.h>
- if ((kp = kvm_getprocs(kd, KINFO_PROC_ALL, 0, &nentries)) == NULL)
+ if ((kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nentries)) == NULL)
error("%s", kvm_geterr(kd));
for (i = 0; i < nentries; i++, kp++) {
register struct proc *p = &kp->kp_proc;
error("%s", kvm_geterr(kd));
for (i = 0; i < nentries; i++, kp++) {
register struct proc *p = &kp->kp_proc;