From owner-svn-src-head@freebsd.org Mon Aug 29 20:01:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B14A1BC8146; Mon, 29 Aug 2016 20:01:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90FF57DF; Mon, 29 Aug 2016 20:01:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3B9ECB9A5; Mon, 29 Aug 2016 16:01:11 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys Date: Mon, 29 Aug 2016 12:59:09 -0700 Message-ID: <2853823.FYjVjBFabd@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160829191035.GV83214@kib.kiev.ua> References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <20160829191035.GV83214@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 29 Aug 2016 16:01:11 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 20:01:12 -0000 On Monday, August 29, 2016 10:10:35 PM Konstantin Belousov wrote: > On Mon, Aug 29, 2016 at 09:16:29PM +0300, Andrey Chernov wrote: > > Previous text is documented everywhere and describing usual good > > practice, so it should remains in place, in that means r304928 should be > > reverted, because replace proper way of doing things with obsoleted > > feature description. > > > > What I suggest is not _replace_ old text with new, but _add_ new text as > > describing current and not recommended way, with the direct mention that > > this feature is obsoleted and not recommended for relay on it. > > > > diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 > index 48802f4..d406efc 100644 > --- a/lib/libc/sys/ptrace.2 > +++ b/lib/libc/sys/ptrace.2 > @@ -2,7 +2,7 @@ > .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ > .\" > .\" This file is in the public domain. > -.Dd August 28, 2016 > +.Dd August 29, 2016 > .Dt PTRACE 2 > .Os > .Sh NAME > @@ -900,19 +900,29 @@ argument is ignored. > .Pp > Additionally, other machine-specific requests can exist. > .Sh RETURN VALUES > +Most requests return 0 on success and \-1 on error. > Some requests can cause > .Fn ptrace > to return > \-1 > -as a non-error value; to disambiguate, > +as a non-error value, among them are > +.Dv PT_READ_I > +and > +.Dv PT_READ_D , > +which return the value read from the process memory on success. > +To disambiguate, > .Va errno > -is set to 0 in the libc wrapper for the > -.Fn ptrace > -system call and > +can be set to 0 before the call and checked afterwards. > +.Pp > +Current > .Fn ptrace > -callers can reliably check > +implementation always sets > +.Va errno > +to 0 before calling into kernel, both for historic reasons and for > +consistency with other operating systems. > +It is recommended to assign zero to > .Va errno > -for non-zero value afterwards. > +explicitely for future compatibility. > .Sh ERRORS > The > .Fn ptrace Thanks, I think this looks good. -- John Baldwin