diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2016-10-08 02:16:44 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2016-10-08 02:16:44 +0000 |
commit | f67f3db92288036f19c8c030cead6016203ccb4c (patch) | |
tree | 46006dfdff5d04db0c9b64b269c241442d56cb2f /sys/kern/sys_pipe.c | |
parent | ab61cc1bf74111d38093d0d771bbb4d2bb6b20be (diff) |
Add ktracing of the fds returned by pipe() and socketpair()
ok deraadt@
Diffstat (limited to 'sys/kern/sys_pipe.c')
-rw-r--r-- | sys/kern/sys_pipe.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 78cce6e6cbe..e869b61cd8b 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_pipe.c,v 1.74 2016/09/15 02:00:16 dlg Exp $ */ +/* $OpenBSD: sys_pipe.c,v 1.75 2016/10/08 02:16:43 guenther Exp $ */ /* * Copyright (c) 1996 John S. Dyson @@ -40,6 +40,9 @@ #include <sys/event.h> #include <sys/lock.h> #include <sys/poll.h> +#ifdef KTRACE +#include <sys/ktrace.h> +#endif #include <uvm/uvm_extern.h> @@ -175,6 +178,10 @@ dopipe(struct proc *p, int *ufds, int flags) fdrelease(p, fds[0]); fdrelease(p, fds[1]); } +#ifdef KTRACE + else if (KTRPOINT(p, KTR_STRUCT)) + ktrfds(p, fds, 2); +#endif fdpunlock(fdp); return (error); |