summaryrefslogtreecommitdiffstats
path: root/sys/sys/user.h
diff options
context:
space:
mode:
authortrociny <trociny@FreeBSD.org>2013-04-14 20:01:36 +0000
committertrociny <trociny@FreeBSD.org>2013-04-14 20:01:36 +0000
commit335f3dbd9136ccf61c363fee13dc4a90c89cce50 (patch)
treeb5d51cb05a61768573b30bd3294f22134dbe82de /sys/sys/user.h
parent99603a0f212eda46b1b439585792e59c69eba194 (diff)
downloadFreeBSD-src-335f3dbd9136ccf61c363fee13dc4a90c89cce50.zip
FreeBSD-src-335f3dbd9136ccf61c363fee13dc4a90c89cce50.tar.gz
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
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 5de76ac..2f6514b 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 */
OpenPOWER on IntegriCloud