Lines Matching defs:kif

3305 pack_kinfo(struct kinfo_file *kif)
3308 kif->kf_structsize = offsetof(struct kinfo_file, kf_path) +
3309 strlen(kif->kf_path) + 1;
3310 kif->kf_structsize = roundup(kif->kf_structsize, sizeof(uint64_t));
3315 struct kinfo_file *kif, struct filedesc *fdp, int flags)
3319 bzero(kif, sizeof(*kif));
3322 kif->kf_type = KF_TYPE_UNKNOWN;
3323 kif->kf_flags = xlate_fflags(fp->f_flag);
3325 kif->kf_cap_rights = *rightsp;
3327 cap_rights_init(&kif->kf_cap_rights);
3328 kif->kf_fd = fd;
3329 kif->kf_ref_count = fp->f_count;
3330 kif->kf_offset = foffset_get(fp);
3336 error = fo_fill_kinfo(fp, kif, fdp);
3338 kif->kf_status |= KF_ATTR_VALID;
3340 pack_kinfo(kif);
3342 kif->kf_structsize = roundup2(sizeof(*kif), sizeof(uint64_t));
3347 struct kinfo_file *kif, int flags)
3351 bzero(kif, sizeof(*kif));
3353 kif->kf_type = KF_TYPE_VNODE;
3354 error = vn_fill_kinfo_vnode(vp, kif);
3356 kif->kf_status |= KF_ATTR_VALID;
3357 kif->kf_flags = xlate_fflags(fflags);
3358 cap_rights_init(&kif->kf_cap_rights);
3359 kif->kf_fd = fd;
3360 kif->kf_ref_count = -1;
3361 kif->kf_offset = -1;
3363 pack_kinfo(kif);
3365 kif->kf_structsize = roundup2(sizeof(*kif), sizeof(uint64_t));
3373 struct kinfo_file kif;
3380 struct kinfo_file *kif;
3382 kif = &efbuf->kif;
3384 if (efbuf->remainder < kif->kf_structsize) {
3389 efbuf->remainder -= kif->kf_structsize;
3391 return (sbuf_bcat(efbuf->sb, kif, kif->kf_structsize) == 0 ? 0 : ENOMEM);
3402 export_file_to_kinfo(fp, fd, rightsp, &efbuf->kif, efbuf->fdp,
3420 export_vnode_to_kinfo(vp, fd, fflags, &efbuf->kif, efbuf->flags);
3556 kinfo_to_okinfo(struct kinfo_file *kif, struct kinfo_ofile *okif)
3560 okif->kf_type = kif->kf_type;
3561 okif->kf_fd = kif->kf_fd;
3562 okif->kf_ref_count = kif->kf_ref_count;
3563 okif->kf_flags = kif->kf_flags & (KF_FLAG_READ | KF_FLAG_WRITE |
3566 okif->kf_offset = kif->kf_offset;
3567 okif->kf_vnode_type = kif->kf_vnode_type;
3568 okif->kf_sock_domain = kif->kf_sock_domain;
3569 okif->kf_sock_type = kif->kf_sock_type;
3570 okif->kf_sock_protocol = kif->kf_sock_protocol;
3571 strlcpy(okif->kf_path, kif->kf_path, sizeof(okif->kf_path));
3572 okif->kf_sa_local = kif->kf_sa_local;
3573 okif->kf_sa_peer = kif->kf_sa_peer;
3577 export_vnode_for_osysctl(struct vnode *vp, int type, struct kinfo_file *kif,
3584 export_vnode_to_kinfo(vp, type, 0, kif, KERN_FILEDESC_PACK_KINFO);
3585 kinfo_to_okinfo(kif, okif);
3598 struct kinfo_file *kif;
3612 kif = malloc(sizeof(*kif), M_TEMP, M_WAITOK);
3616 export_vnode_for_osysctl(fdp->fd_cdir, KF_FD_TYPE_CWD, kif,
3619 export_vnode_for_osysctl(fdp->fd_rdir, KF_FD_TYPE_ROOT, kif,
3622 export_vnode_for_osysctl(fdp->fd_jdir, KF_FD_TYPE_JAIL, kif,
3627 export_file_to_kinfo(fp, i, NULL, kif, fdp,
3630 kinfo_to_okinfo(kif, okif);
3638 free(kif, M_TEMP);
3966 badfo_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp)