Lines Matching refs:kd
83 kvm_deadfiles(kvm_t *kd, int op, int arg, long ofhead, int numfiles)
85 size_t buflen = kd->argspc_len, n = 0;
88 char *where = kd->argspc;
94 KREAD(kd, (u_long)ofhead, &fhead)) {
95 _kvm_err(kd, kd->program, "can't read filehead");
100 (void)memcpy(kd->argspc, &fhead, sizeof(fhead));
107 if (KREAD(kd, (u_long)fp,
109 _kvm_err(kd, kd->program, "can't read kfp");
119 _kvm_err(kd, kd->program, "inconsistent nfiles");
126 kvm_getfiles(kvm_t *kd, int op, int arg, int *cnt)
134 if (ISSYSCTL(kd)) {
140 _kvm_syserr(kd, kd->program, "kvm_getprocs");
143 KVM_ALLOC(kd, argspc, size);
144 st = sysctl(mib, 2, kd->argspc, &size, NULL, 0);
146 _kvm_syserr(kd, kd->program, "kvm_getfiles");
149 (void)memcpy(&fhead, kd->argspc, sizeof(fhead));
150 fp = (struct file *)(void *)(kd->argspc + sizeof(fhead));
151 fplim = (struct file *)(void *)(kd->argspc + size);
162 if (kvm_nlist(kd, nl) != 0) {
165 _kvm_err(kd, kd->program,
169 if (KREAD(kd, nl[0].n_value, &numfiles)) {
170 _kvm_err(kd, kd->program, "can't read numfiles");
174 KVM_ALLOC(kd, argspc, size);
175 numfiles = kvm_deadfiles(kd, op, arg, (long)nl[1].n_value,
181 return (kd->argspc);