aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/user.h
diff options
context:
space:
mode:
authorMikolaj Golub <trociny@FreeBSD.org>2013-04-14 20:01:36 +0000
committerMikolaj Golub <trociny@FreeBSD.org>2013-04-14 20:01:36 +0000
commitfe52cf547580ad4d5be87fdc754bd57a80b35759 (patch)
treeb5d51cb05a61768573b30bd3294f22134dbe82de /sys/sys/user.h
parentbd3902134c2636d06dd96591f13c4b23739ed1ea (diff)
downloadsrc-fe52cf547580ad4d5be87fdc754bd57a80b35759.tar.gz
src-fe52cf547580ad4d5be87fdc754bd57a80b35759.zip
Re-factor the code to provide kern_proc_filedesc_out(), kern_proc_out(),
and kern_proc_vmmap_out() functions to output process kinfo structures to sbuf, to make the code reusable. The functions are going to be used in the coredump routine to store procstat info in the core program header notes. Reviewed by: kib MFC after: 3 weeks
Notes
Notes: svn path=/head/; revision=249487
Diffstat (limited to 'sys/sys/user.h')
-rw-r--r--sys/sys/user.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/sys/user.h b/sys/sys/user.h
index 5de76acaa5b4..2f6514bb25e6 100644
--- a/sys/sys/user.h
+++ b/sys/sys/user.h
@@ -491,6 +491,25 @@ struct kinfo_kstack {
};
#ifdef _KERNEL
+/* Flags for kern_proc_out function. */
+#define KERN_PROC_NOTHREADS 0x1
+#define KERN_PROC_MASK32 0x2
+
+struct sbuf;
+
+/*
+ * The kern_proc out functions are helper functions to dump process
+ * miscellaneous kinfo structures to sbuf. The main consumers are KERN_PROC
+ * sysctls but they may also be used by other kernel subsystems.
+ *
+ * The functions manipulate the process locking state and expect the process
+ * to be locked on enter. On return the process is unlocked.
+ */
+
+int kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen);
+int kern_proc_out(struct proc *p, struct sbuf *sb, int flags);
+int kern_proc_vmmap_out(struct proc *p, struct sbuf *sb);
+
int vntype_to_kinfo(int vtype);
#endif /* !_KERNEL */