Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Aug 2016 14:14:41 -0500
From:      Benjamin Kaduk <bjkfbsd@gmail.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Andrey Chernov <ache@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>,  "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,  "src-committers@freebsd.org" <src-committers@freebsd.org>, John Baldwin <jhb@freebsd.org>
Subject:   Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys
Message-ID:  <CAJ5_RoBiwiYN9k8ans8MgabcepRmpu_LDC7aFrLvGoQ3tU2BBw@mail.gmail.com>
In-Reply-To: <20160829191035.GV83214@kib.kiev.ua>
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> <a6921ce6-ca99-6ee9-24de-fe90a440879d@freebsd.org> <20160829191035.GV83214@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 29, 2016 at 2:10 PM, Konstantin Belousov <kostikbel@gmail.com>
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
>

The current


>  .Fn ptrace
> -callers can reliably check
> +implementation always sets
> +.Va errno
> +to 0 before calling into kernel, both for historic reasons and for
>

the kernel


> +consistency with other operating systems.
> +It is recommended to assign zero to
>  .Va errno
> -for non-zero value afterwards.
> +explicitely for future compatibility.
>

"explicitly" (only one 'e')

Maybe forward compatibility instead of future compatibility, but either is
fine.

Feel free to commit with reviewed-by: bjk

-Ben


>  .Sh ERRORS
>  The
>  .Fn ptrace
> _______________________________________________
> svn-src-all@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ5_RoBiwiYN9k8ans8MgabcepRmpu_LDC7aFrLvGoQ3tU2BBw>