From owner-svn-src-all@freebsd.org Sun Aug 28 00:50:13 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 9191EA94332 for ; Sun, 28 Aug 2016 00:50:13 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (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 F1D7F3CA for ; Sun, 28 Aug 2016 00:50:12 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f48.google.com with SMTP id b199so79411392lfe.0 for ; Sat, 27 Aug 2016 17:50:12 -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:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=yTiGsqRm/ulrXF7bIzUDTyHbq7lndqDcad34tP1k1dI=; b=g5ZjR8nqaJAyo0e0kRoY3ZTyldQx04AZk3RSLEisMgexSdW26Pp9UWsDNFbIG20QPu YZh0+gy+27cub/U5TszlWhV1UPPkTaa5gjNuzNzYBFXdkVkZShWYlTi5IGIQHkbOo1CL /PI+mfq/WqJ3mIlTARACkDbLJ2FNWN6WSMOJ8A9xcsMDseG9oft6/2U4C+07Qe7LNkWc KfxYa7qFygPsJhliHT7LvT7aMd439TcpVkTm/biG+VaShMBNTcHRMaoDHvHqYYa7UwRc 0B6F26SYQAPOewI8+oiqzclhUP2cg5n/wa4AiEDtbBaEcUpAA1mKFQKYkn3QYh28OGO1 cV5A== X-Gm-Message-State: AE9vXwO1DI0XponQvoVX7mwzS3HrbceK74PqMmjdWqK2ojo6Br+ApDsc2dNV3Sp0BnTOMQ== X-Received: by 10.25.24.30 with SMTP id o30mr3530392lfi.58.1472345405298; Sat, 27 Aug 2016 17:50:05 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id d15sm5211028lfg.0.2016.08.27.17.50.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Aug 2016 17:50:04 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> From: Andrey Chernov Message-ID: Date: Sun, 28 Aug 2016 03:50:04 +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: <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> 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: Sun, 28 Aug 2016 00:50:13 -0000 On 28.08.2016 3:38, Andrey Chernov wrote: > On 28.08.2016 2:03, Konstantin Belousov wrote: >> Since ptrace(2) syscall can return -1 for non-error situations, libc >> wrappers set errno to 0 before performing the syscall, as the service >> to the caller. > > Both C99 and POSIX directly prohibits any standard function to set errno > to 0. ptrace() should either choose other errno to indicate non-error > situation or change return -1 to something else. > ...and don't touch errno. POSIX: "No function in this volume of POSIX.1-2008 shall set errno to zero." > On both i386 and amd64, the errno symbol was directly > referenced, which only works correctly in single-threaded process. POSIX: "For each thread of a process, the value of errno shall not be affected by function calls or assignments to errno by other threads."