summaryrefslogtreecommitdiffstats
path: root/lib/libkvm/kvm_file2.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2015-08-28 04:38:47 +0000
committerguenther <guenther@openbsd.org>2015-08-28 04:38:47 +0000
commit171fc181543e7ac425f46aec98f388d2e7abae0c (patch)
treeb4ead563c1f981843122b559ac53fb9287e846e7 /lib/libkvm/kvm_file2.c
parentModify ttystats_init() to tell us about the buffer size, so that we (diff)
downloadwireguard-openbsd-171fc181543e7ac425f46aec98f388d2e7abae0c.tar.xz
wireguard-openbsd-171fc181543e7ac425f46aec98f388d2e7abae0c.zip
Rework the UNIX domain socket garbage collector, including ideas from
{Free,Net}BSD - when a socket is closed with fds in its input, defer closing them to a task to avoid recursing. This eliminates the complicated extra reference taking which had a 37 line(!) comment explanation - move flags, counts, and links only needed for this from struct file to struct unpcb - document the flow of the mark/sweep collector much help from claudio@ who made me explain the GC to him until we trusted it ok claudio@ mpi@ deraadt@
Diffstat (limited to 'lib/libkvm/kvm_file2.c')
-rw-r--r--lib/libkvm/kvm_file2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libkvm/kvm_file2.c b/lib/libkvm/kvm_file2.c
index bd2ba2b9af8..04912bf2562 100644
--- a/lib/libkvm/kvm_file2.c
+++ b/lib/libkvm/kvm_file2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_file2.c,v 1.45 2015/03/28 23:50:55 bluhm Exp $ */
+/* $OpenBSD: kvm_file2.c,v 1.46 2015/08/28 04:38:47 guenther Exp $ */
/*
* Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -484,7 +484,6 @@ fill_file(kvm_t *kd, struct kinfo_file *kf, struct file *fp, u_long fpaddr,
kf->f_iflags = fp->f_iflags;
kf->f_type = fp->f_type;
kf->f_count = fp->f_count;
- kf->f_msgcount = fp->f_msgcount;
kf->f_ucred = PTRTOINT64(fp->f_cred);
kf->f_uid = f_cred.cr_uid;
kf->f_gid = f_cred.cr_gid;
@@ -655,6 +654,7 @@ fill_file(kvm_t *kd, struct kinfo_file *kf, struct file *fp, u_long fpaddr,
_kvm_err(kd, kd->program, "can't read unpcb");
return (-1);
}
+ kf->f_msgcount = unpcb.unp_msgcount;
kf->unp_conn = PTRTOINT64(unpcb.unp_conn);
kf->unp_refs = PTRTOINT64(
SLIST_FIRST(&unpcb.unp_refs));