Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/sys Document PTRACE_VFORK and PTRACE_VFORK_DONE in ...



details:   https://anonhg.NetBSD.org/src/rev/910afdfcb501
branches:  trunk
changeset: 820726:910afdfcb501
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sat Jan 14 00:02:40 2017 +0000

description:
Document PTRACE_VFORK and PTRACE_VFORK_DONE in ptrace(2)

PTRACE_VFORK - report vfork(2)-like operations and trace child
PTRACE_VFORK_DONE - report unblocking the parent after vfork(2)-like call

Note that PTRACE_VFORK is currently unimplemented and returns ENOTSUP.

Sponsored by <The NetBSD Foundation>

diffstat:

 lib/libc/sys/ptrace.2 |  30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)

diffs (66 lines):

diff -r 992d607dccd9 -r 910afdfcb501 lib/libc/sys/ptrace.2
--- a/lib/libc/sys/ptrace.2     Fri Jan 13 23:29:10 2017 +0000
+++ b/lib/libc/sys/ptrace.2     Sat Jan 14 00:02:40 2017 +0000
@@ -1,7 +1,7 @@
-.\"    $NetBSD: ptrace.2,v 1.52 2017/01/11 07:32:36 kamil Exp $
+.\"    $NetBSD: ptrace.2,v 1.53 2017/01/14 00:02:40 kamil Exp $
 .\"
 .\" This file is in the public domain.
-.Dd January 11, 2016
+.Dd January 13, 2016
 .Dt PTRACE 2
 .Os
 .Sh NAME
@@ -379,11 +379,19 @@
 .It PTRACE_FORK
 Report
 .Xr fork 2 .
+.It PTRACE_VFORK
+Report
+.Xr vfork 2 .
+.It PTRACE_VFORK_DONE
+Report parent resumed after
+.Xr vfork 2 .
 .El
 .Pp
 The
 .Xr fork 2
-event can occur with similar operations,
+and
+.Xr vfork 2
+events can occur with similar operations,
 like
 .Xr clone 2
 or
@@ -391,12 +399,22 @@
 The
 .Dv PTRACE_FORK
 value means that process gives birth to its child
-without pending on its termination.
+without pending on its termination or
+.Xr execve 2
+operation.
 If enabled,
 the child is also traced by the debugger and
 .Dv SIGRAP
 is generated twice,
 first for the parent and second for the child.
+The
+.Dv PTRACE_VFORK
+is the same like
+.Dv PTRACE_FORK ,
+but the parent blocks after giving birth to the child.
+The
+.Dv PTRACE_VFORK_DONE
+event can be used to report unblocking of the parent.
 .Pp
 A pointer to this structure is passed in
 .Fa addr .
@@ -698,3 +716,7 @@
 .Fn ptrace
 .Ec ,
 should be able to sidestep this.
+.Pp
+.Dv PTRACE_VFORK
+is currently unimplemented and it will return
+.Dv ENOTSUP .



Home | Main Index | Thread Index | Old Index