/src/lib/libc/gen/ |
getdevmajor.c | 69 struct kinfo_drivers kd[200], *kdp = &kd[0]; local in function:getdevmajor 70 size_t i, sz = sizeof(kd); 84 if (kdp != &kd[0]) 106 if (kdp != &kd[0])
|
/src/usr.sbin/schedctl/ |
schedctl.c | 72 kvm_t *kd; local in function:main 160 kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, "kvm_open"); 161 if (kd == NULL) 163 lwp_list = kvm_getlwps(kd, pid, 0, sizeof(struct kinfo_lwp), &count); 173 kvm_close(kd);
|
/src/sbin/mknod/ |
mknod.c | 354 struct kinfo_drivers *kd; local in function:print_device_info 360 kd = kern_drivers; 361 for (i = 0; i < num_drivers; kd++, i++) { 362 if (*names && strcmp(*names, kd->d_name)) 364 printf("%s", kd->d_name); 365 if (kd->d_cmajor != -1) 366 printf(" character major %d", kd->d_cmajor); 367 if (kd->d_bmajor != -1) 368 printf(" block major %d", kd->d_bmajor); 378 struct kinfo_drivers *kd; local in function:major_from_name [all...] |
/src/sbin/dmesg/ |
dmesg.c | 76 kvm_read(kd, addr, &var, sizeof(var)) != sizeof(var) 220 kvm_t *kd; local in function:main 227 kd = kvm_open(nlistf, memf, NULL, O_RDONLY, "dmesg"); 228 if (kd == NULL) 230 if (kvm_nlist(kd, nl) == -1) 231 errx(1, "kvm_nlist: %s", kvm_geterr(kd)); 236 errx(1, "kvm_read: %s (0x%lx)", kvm_geterr(kd), 238 if (kvm_read(kd, (long)bufp, &cur, 241 errx(1, "kvm_read: %s (0x%lx)", kvm_geterr(kd), 248 if (kvm_read(kd, (long)&bufp->msg_bufc, bufdata [all...] |
/src/sys/arch/sparc/dev/ |
kd.c | 1 /* $NetBSD: kd.c,v 1.54 2014/07/25 08:10:34 dholland Exp $ */ 42 __KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.54 2014/07/25 08:10:34 dholland Exp $"); 131 kd_init(struct kd_softc *kd) 142 kd->kd_tty = tp; 149 kd->rows = fbrcons_rows(); 150 kd->cols = fbrcons_cols(); 161 if (kd->rows == 0) 162 kd->rows = (u_short)ep->eeTtyRows; 163 if (kd->cols == 0) 164 kd->cols = (u_short)ep->eeTtyCols 188 struct kd_softc *kd; local in function:kdtty 197 struct kd_softc *kd; local in function:kdopen 252 struct kd_softc *kd; local in function:kdclose 275 struct kd_softc *kd; local in function:kdread 287 struct kd_softc *kd; local in function:kdwrite 299 struct kd_softc *kd; local in function:kdpoll 311 struct kd_softc *kd; local in function:kdioctl 422 struct kd_softc *kd = &kd_softc; local in function:kd_cons_input 438 struct kd_softc *kd = &kd_softc; local in function:cons_attach_input 447 struct kd_softc *kd = &kd_softc; local in function:kd_attach_input [all...] |
/src/sys/arch/sparc64/dev/ |
kd.c | 1 /* $NetBSD: kd.c,v 1.53 2014/07/25 08:10:35 dholland Exp $ */ 42 __KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.53 2014/07/25 08:10:35 dholland Exp $"); 124 kd_init(struct kd_softc *kd) 129 kd = &kd_softc; /* XXX */ 138 kd->kd_tty = tp; 147 if (kd->rows == 0 && 149 kd->rows = strtoul(prop, NULL, 10); 151 if (kd->cols == 0 && 153 kd->cols = strtoul(prop, NULL, 10); 159 struct kd_softc *kd; local in function:kdtty 168 struct kd_softc *kd; local in function:kdopen 224 struct kd_softc *kd; local in function:kdclose 247 struct kd_softc *kd; local in function:kdread 259 struct kd_softc *kd; local in function:kdwrite 271 struct kd_softc *kd; local in function:kdpoll 283 struct kd_softc *kd; local in function:kdioctl 425 struct kd_softc *kd = &kd_softc; local in function:kd_cons_input 465 struct kd_softc *kd = &kd_softc; local in function:cons_attach_input 502 struct kd_softc *kd = &kd_softc; local in function:kd_attach_input [all...] |
/src/sys/arch/sun2/dev/ |
kd.c | 1 /* $NetBSD: kd.c,v 1.25 2014/07/25 08:10:35 dholland Exp $ */ 42 __KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.25 2014/07/25 08:10:35 dholland Exp $"); 127 kd_init(struct kd_softc *kd) 138 kd = &kd_softc; /* XXX */ 147 kd->kd_tty = tp; 155 kd->rows = fbrcons_rows(); 156 kd->cols = fbrcons_cols(); 167 if (kd->rows == 0) 168 kd->rows = (u_short)ep->eeTtyRows; 169 if (kd->cols == 0 202 struct kd_softc *kd; local in function:kdtty 211 struct kd_softc *kd; local in function:kdopen 267 struct kd_softc *kd; local in function:kdclose 290 struct kd_softc *kd; local in function:kdread 302 struct kd_softc *kd; local in function:kdwrite 314 struct kd_softc *kd; local in function:kdpoll 326 struct kd_softc *kd; local in function:kdioctl 470 struct kd_softc *kd = &kd_softc; local in function:kd_cons_input 511 struct kd_softc *kd = &kd_softc; local in function:cons_attach_input 548 struct kd_softc *kd = &kd_softc; local in function:kd_attach_input [all...] |
/src/usr.bin/nfsstat/ |
nfsstat.c | 107 static kvm_t *kd; variable in typeref:typename:kvm_t * 160 if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf)) 164 if (kvm_nlist(kd, nl) != 0) 168 kd = NULL; 184 if (kd) { 185 if (kvm_read(kd, (u_long)nfsstataddr, ns, sizeof(*ns))
|
/src/usr.sbin/trpt/ |
trpt.c | 149 static kvm_t *kd; variable in typeref:typename:kvm_t * 222 kd = kvm_openfiles(kernel, core, NULL, O_RDONLY, errbuf); 223 if (kd == NULL) 226 if (kvm_nlist(kd, nl)) 229 if (kvm_read(kd, nl[N_TCP_DEBX].n_value, (char *)&tcp_debx, 231 errx(3, "tcp_debx: %s", kvm_geterr(kd)); 233 if (kvm_read(kd, nl[N_TCP_DEBUG].n_value, (char *)tcp_debug, 235 errx(3, "tcp_debug: %s", kvm_geterr(kd)); 354 if (kvm_read(kd, nl[N_TCP_DEBX].n_value, 358 kvm_geterr(kd)); [all...] |
/src/lib/libkvm/ |
kvm.c | 87 kvm_geterr(kvm_t *kd) 89 return (kd->errbuf); 93 kvm_getkernelname(kvm_t *kd) 95 return kd->kernelname; 99 * Report an error using printf style arguments. "program" is kd->program 105 _kvm_err(kvm_t *kd, const char *program, const char *fmt, ...) 115 (void)vsnprintf(kd->errbuf, 116 sizeof(kd->errbuf), fmt, ap); 122 _kvm_syserr(kvm_t *kd, const char *program, const char *fmt, ...) 133 char *cp = kd->errbuf 728 kvm_t *kd; local in function:kvm_openfiles 742 kvm_t *kd; local in function:kvm_open [all...] |
/src/usr.bin/systat/ |
main.c | 64 kvm_t *kd; variable in typeref:typename:kvm_t * 182 kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf); 183 if (kd == NULL)
|
/src/usr.sbin/crash/ |
crash.c | 68 static kvm_t *kd; variable in typeref:typename:kvm_t * 135 if ((size_t)kvm_write(kd, addr, str, size) != size) { 137 kvm_geterr(kd)); 146 if ((size_t)kvm_read(kd, addr, str, size) != size) { 148 kvm_geterr(kd)); 392 kd = kvm_open(nlistf, memf, NULL, flags, getprogname()); 393 if (kd == NULL) { 427 if (kvm_nlist(kd, nl) == -1) { 428 errx(EXIT_FAILURE, "kvm_nlist: %s", kvm_geterr(kd)); 430 if ((size_t)kvm_read(kd, nl[X_OSRELEASE].n_value, imgrelease [all...] |
/src/sys/arch/sun3/dev/ |
kd.c | 1 /* $NetBSD: kd.c,v 1.61 2024/12/21 17:40:11 tsutsui Exp $ */ 42 __KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.61 2024/12/21 17:40:11 tsutsui Exp $"); 116 kd_init(struct kd_softc *kd) 128 kd->kd_tty = tp; 136 struct kd_softc *kd; local in function:kdtty 138 kd = &kd_softc; /* XXX */ 139 return (kd->kd_tty); 145 struct kd_softc *kd; local in function:kdopen 153 kd = &kd_softc; /* XXX */ 155 kd_init(kd); 197 struct kd_softc *kd; local in function:kdclose 218 struct kd_softc *kd; local in function:kdread 230 struct kd_softc *kd; local in function:kdwrite 242 struct kd_softc *kd; local in function:kdpoll 254 struct kd_softc *kd; local in function:kdioctl 373 struct kd_softc *kd = &kd_softc; local in function:cons_attach_input 408 struct kd_softc *kd = &kd_softc; local in function:kd_cons_input [all...] |
/src/usr.sbin/kgmon/ |
kgmon.c | 71 kvm_t *kd; member in struct:kvmvars 223 kvp->kd = kvm_openfiles(sys, kmemf, NULL, openmode, errbuf); 224 if (kvp->kd == NULL) { 227 kvp->kd = kvm_openfiles(sys, kmemf, NULL, O_RDONLY, 230 if (kvp->kd == NULL) 234 if (kvm_nlist(kvp->kd, nl) < 0) 270 size = kvm_read(kvp->kd, nl[N_GMONPARAM].n_value, &kvp->gpm, 291 kflag ? kvm_geterr(kvp->kd) : strerror(errno)); 329 } else if ((size_t)kvm_write(kvp->kd, (u_long)&p->state, (void *)&state, sz) 400 i = kvm_read(kvp->kd, (u_long)kvp->gpm.kcount, tickbuf [all...] |
/src/usr.bin/pmap/ |
main.c | 114 kvm_t *kd; local in function:main 250 kd = kvm_openfiles(kernel, kmem, NULL, O_RDONLY, errbuf); 259 if (kd == NULL) 263 load_symbols(kd); 274 /* (kd, kproc, vmspace, thing) */ 275 (*process_map)(kd, NULL, at, "vm_map"); 278 /* (kd, proc, vmspace, vm_map, thing) */ 279 (*dump_vm_map)(kd, NULL, vmspace, at, "vm_map"); 282 /* (kd, proc, vmspace, vm_map_entry, 0) */ 283 (*dump_vm_map_entry)(kd, NULL, vmspace, at, 0) [all...] |
/src/sys/kern/ |
subr_kcov.c | 92 * The KCOV descriptors (KD) are allocated during open(), and are associated 95 * An LWP can 'enable' a KD. When this happens, this LWP becomes the owner of 96 * the KD, and no LWP can 'disable' this KD except the owner. 98 * A KD is freed when its file descriptor is closed _iff_ the KD is not active 128 kcov_lock(kcov_t *kd) 131 mutex_enter(&kd->lock); 135 kcov_unlock(kcov_t *kd) 138 mutex_exit(&kd->lock) 171 kcov_t *kd = (kcov_t *)l->l_kcov; local in function:kcov_lwp_free 226 kcov_t kd; member in struct:kcov_remote 250 kcov_t *kd; local in function:kcov_remote_register 276 kcov_t *kd; local in function:kcov_remote_enter 430 kcov_t *kd = curlwp->l_kcov; local in function:kcov_silence_enter 439 kcov_t *kd = curlwp->l_kcov; local in function:kcov_silence_leave 452 kcov_t *kd; local in function:kcov_open 467 kcov_t *kd = fp->f_data; local in function:kcov_fops_close 487 kcov_t *kd; local in function:kcov_fops_ioctl 524 kcov_t *kd, *kdbuf; local in function:kcov_fops_mmap 583 kcov_t *kd; local in function:__sanitizer_cov_trace_pc 629 kcov_t *kd; local in function:trace_cmp [all...] |
init_sysctl.c | 1265 struct kinfo_drivers kd; local in function:sysctl_kern_drivers 1275 *oldlenp = max_devsw_convs * sizeof kd; 1289 if (buflen < sizeof kd) { 1293 memset(&kd, 0, sizeof(kd)); 1294 kd.d_bmajor = devsw_conv[i].d_bmajor; 1295 kd.d_cmajor = devsw_conv[i].d_cmajor; 1296 strlcpy(kd.d_name, dname, sizeof kd.d_name); 1298 error = dcopyout(l, &kd, where, sizeof kd) [all...] |
/src/sys/arch/atari/dev/ |
kbd.c | 874 struct wskbd_bell_data *kd; local in function:kbd_ioctl 878 kd = (struct wskbd_bell_data *)data; 879 kbd_bell(0, kd->pitch, kd->period, kd->volume);
|
/src/usr.bin/pkill/ |
pkill.c | 100 static kvm_t *kd; variable in typeref:typename:kvm_t * 283 kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, buf); 284 if (kd == NULL) 287 plist = kvm_getproc2(kd, KERN_PROC_ALL, 0, sizeof(*plist), &nproc); 290 kvm_geterr(kd)); 315 if ((pargv = kvm_getargv2(kd, kp, 0)) == NULL) 560 if ((argv = kvm_getargv2(kd, kp, 0)) == NULL)
|
/src/usr.bin/w/ |
w.c | 91 kvm_t *kd; variable in typeref:typename:kvm_t * 199 if ((kd = kvm_openfiles(nlistf, memf, NULL, 328 if ((kp = kvm_getproc2(kd, KERN_PROC_ALL, 0, 330 errx(1, "%s", kvm_geterr(kd)); 443 argv = kvm_getargv2(kd, kp, (argwidth < 0) ? 0 : argwidth); 610 l1 = kvm_getlwps(kd, p1->p_pid, 0, sizeof(*l1), &cnt); 614 l2 = kvm_getlwps(kd, p2->p_pid, 0, sizeof(*l1), &cnt);
|
/src/bin/ps/ |
ps.c | 149 kvm_t *kd; variable in typeref:typename:kvm_t * 406 kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf); 409 kd = kvm_openfiles(nlistf, memf, swapf, O_RDONLY, errbuf); 411 if (kd == NULL) 442 if (!(kinfo = getkinfo_kvm(kd, what, flag, &nentries))) 443 errx(EXIT_FAILURE, "%s", kvm_geterr(kd)); 475 kl = kvm_getlwps(kd, ki->p_pid, ki->p_paddr, 510 kl = kvm_getlwps(kd, ki->p_pid, (u_long)ki->p_paddr,
|
/src/usr.sbin/pstat/ |
pstat.c | 112 kvm_t *kd; variable in typeref:typename:kvm_t * 136 if (kvm_read(kd, (u_long)(addr), p, s) != s) \ 137 warnx("cannot read %s: %s", msg, kvm_geterr(kd)); \ 140 if (kvm_read(kd, (u_long)(addr), p, s) != s) { \ 141 warnx("cannot read %s: %s", msg, kvm_geterr(kd)); \ 254 if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, buf)) == 0) 260 if ((ret = kvm_nlist(kd, nl)) != 0) { 262 errx(1, "kvm_nlist: %s", kvm_geterr(kd));
|
/src/usr.bin/fstat/ |
fstat.c | 153 kvm_t *kd; variable in typeref:typename:kvm_t * 281 if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, buf)) == NULL) 288 if ((p = kvm_getproc2(kd, what, arg, sizeof *p, &cnt)) == NULL) { 289 errx(1, "%s", kvm_geterr(kd)); 1096 if ((len = kvm_read(kd, (u_long)dom.dom_name, dname, 1128 if (kvm_read(kd, (u_long)so.so_pcb, (char *)&in4pcb, 1153 if (kvm_read(kd, (u_long)so.so_pcb, (char *)&in6pcb, 1186 if (kvm_read(kd, (u_long)pcb[p], (char *)&unpcb, 1208 if (kvm_read(kd, (u_long)unpcb.unp_addr, 1236 if (kvm_read(kd, (u_long)so.so_pcb, (char *)&ddpcb [all...] |
/src/sbin/sysctl/ |
sysctl.c | 2353 struct kinfo_drivers *kd; local in function:kern_drivers 2364 if (sz % sizeof(*kd)) 2367 kd = malloc(sz); 2368 if (kd == NULL) { 2373 rc = prog_sysctl(name, namelen, kd, &sz, NULL, 0); 2376 free(kd); 2383 for (i = 0, sz /= sizeof(*kd); i < sz; i++) { 2384 (void)printf("%s[%d %d %s]", comma, kd[i].d_cmajor, 2385 kd[i].d_bmajor, kd[i].d_name) [all...] |
/src/usr.bin/vmstat/ |
vmstat.c | 259 kvm_t *kd; variable in typeref:typename:kvm_t * 423 kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf); 425 kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf); 428 if (kd == NULL) 536 if ((c = kvm_nlist(kd, namelist)) != 0) { 540 "namelist", kvm_geterr(kd)); 558 if ((c = kvm_nlist(kd, timenl)) == -1 || c == X_TIMENL_SIZE) 559 errx(1, "kvm_nlist: %s %s", "timenl", kvm_geterr(kd)); 563 (void) kvm_nlist(kd, intrnl); 567 if ((c = kvm_nlist(kd, hashnl)) == -1 || c == X_HASHNL_SIZE [all...] |