From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 16:44:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53069D36 for ; Tue, 22 Jul 2014 16:44:49 +0000 (UTC) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD6812B10 for ; Tue, 22 Jul 2014 16:44:48 +0000 (UTC) Received: by mail-lb0-f169.google.com with SMTP id s7so6256220lbd.14 for ; Tue, 22 Jul 2014 09:44:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=DoRe0Y0C72NGvWraBvzaDi4LuH2RBXEDmhsIlbk3+x0=; b=dURWl9EVlUHPvLpCbBC9HIsfk0x//fN+WFcBHqvrIN2jJEDowphEACcKxNRpMzJjbN JPvOixBwZ6R41T7Sjrl+IgSKx5XVT2rBAXtgBV+dtBI9BLfZ9IjMoofJGNVEwAfJ4iev 461lTNU1Rzgfn3iugqWitP4uwVijdDpn24FmAhCgBQEutME7LYZroJ6E5C6jkvlp4ED1 j0li4SdJ6XRbPbNpJ8Fnn7dZeC2isKSSHESh1twg3LACf4Mq8F6X30Tgg4Gej08aSEMh eA/7CfvQQH44+yTNaCBxwxG6pXg8Jos/hYlXwQB/0BEpUU/xAmfqjDSdi06HX74YSKvd NvFw== X-Gm-Message-State: ALoCoQl4H8HvJ8eGRwFwA9DOkBrJpAXRjf/0JsS2fEoArMZWECinLuUk6w22UrTkT8lyR6xv+4E8 X-Received: by 10.152.25.229 with SMTP id f5mr13472857lag.87.1406047486378; Tue, 22 Jul 2014 09:44:46 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id xm1sm1283864lbb.15.2014.07.22.09.44.45 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jul 2014 09:44:45 -0700 (PDT) Message-ID: <53CE94F6.3090003@freebsd.org> Date: Tue, 22 Jul 2014 20:44:38 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268984 - head/lib/libc/stdio References: <201407221619.s6MGJ10G068003@svn.freebsd.org> In-Reply-To: <201407221619.s6MGJ10G068003@svn.freebsd.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 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: Tue, 22 Jul 2014 16:44:49 -0000 Producing physical writes on ftell cause great performance degradation. You should check for __SAPP flag before calling sflush to do this only for append-mode files. On 22.07.2014 20:19, Pedro F. Giffuni wrote: > Author: pfg > Date: Tue Jul 22 16:19:01 2014 > New Revision: 268984 > URL: http://svnweb.freebsd.org/changeset/base/268984 > > Log: > ftello: return 1 when seeking offset on an append stream. > > Obtained from: Apple Inc. (Libc 997.90.3) > Phabric: D442 > MFC after: 2 weeks > > Modified: > head/lib/libc/stdio/ftell.c > > Modified: head/lib/libc/stdio/ftell.c > ============================================================================== > --- head/lib/libc/stdio/ftell.c Tue Jul 22 16:10:56 2014 (r268983) > +++ head/lib/libc/stdio/ftell.c Tue Jul 22 16:19:01 2014 (r268984) > @@ -97,6 +97,8 @@ _ftello(FILE *fp, fpos_t *offset) > * Find offset of underlying I/O object, then > * adjust for buffered bytes. > */ > + if (__sflush(fp)) /* may adjust seek offset on append stream */ > + return (1); > if (fp->_flags & __SOFF) > pos = fp->_offset; > else { > -- http://ache.vniz.net/