diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2015-08-28 04:38:48 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2015-08-28 04:38:48 +0000 |
commit | 5d513420a7fc3c0221798248e7cd1907078c3630 (patch) | |
tree | 7aa6da389df2f4182073f9ed0e295a4415b3b557 /lib/libkvm/kvm_file2.c | |
parent | ed25cc9e5c43502e76502b6c4b906ef4ef5ef0a0 (diff) |
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.c | 4 |
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)); |