From owner-svn-src-all@freebsd.org Mon Aug 29 19:26:14 2016 Return-Path: Delivered-To: svn-src-all@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 41065BC779F for ; Mon, 29 Aug 2016 19:26:14 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD094CB4 for ; Mon, 29 Aug 2016 19:26:13 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f43.google.com with SMTP id f93so108056138lfi.2 for ; Mon, 29 Aug 2016 12:26:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=xGOHnyqsFd/M3LhdEWQ9P/Qr9fJdEIa29ysTSO8XZ/g=; b=mZt1csEZTc9de0rk5tGcAuU19EhEqHhaDhusW/QLoK23juXRa3X+o51WjkGgnaUyey OolxlXI2iMHF7W8qHAQpV9/ezwMTpMTo3bdDYQTsRlU5vuDfvMzDCYMblObm0+A805lm 8/0eCD66xbO22ELH8iHGTvDJcli1HfKUhnesMfiOjSlQgAOYnVfO/5sMbkBQrS7kx0M0 I9MXL7MyAAUNjx14vpaS8+MLVJ260MpogpijaMZn1NAA7VvKtUlH56eRqzvImSzi74sb IwIzX6coj6fBKPSVdoHvNzq/E/dLex2UGAA6iPHOu1tL9ynUk8GyVFYclw8OJdqzNs56 pisg== X-Gm-Message-State: AE9vXwO5LVDyPymd0AwXx9/hpkmlMIPQrihTXan5sJUv1iX8bUh+nGHOrQ5M/LKZCeWY2Q== X-Received: by 10.25.85.198 with SMTP id j189mr6161937lfb.31.1472498771159; Mon, 29 Aug 2016 12:26:11 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id n128sm6709935lfb.45.2016.08.29.12.26.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Aug 2016 12:26:10 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <1595604.93PBdSz0kX@ralph.baldwin.cx> <20160829065813.GP83214@kib.kiev.ua> <18206408.GMLM77D01s@ralph.baldwin.cx> <20160829180454.GU83214@kib.kiev.ua> <20160829191035.GV83214@kib.kiev.ua> Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <450d34cd-9b7c-941e-fa6e-9cb358c93307@freebsd.org> Date: Mon, 29 Aug 2016 22:26:08 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160829191035.GV83214@kib.kiev.ua> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 19:26:14 -0000 On 29.08.2016 22:10, 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 > Ok.