From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 16:44:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDD5FD7D for ; Tue, 22 Jul 2014 16:44:54 +0000 (UTC) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) (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 52ACA2B12 for ; Tue, 22 Jul 2014 16:44:54 +0000 (UTC) Received: by mail-lb0-f179.google.com with SMTP id v6so6168861lbi.38 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=bcgcll40jqveGgiLdZr7Y8O9UZVlD4Nh8JLAYmuqPMWe9beBOtUpnpb4DIQyGvFdec cewyG68vJqrAcv2zJX3bQokc//x656wxu3RH9BmSj7DLdHqw07HIwBsP3+emqVHxwZ69 rn5ts289ry3ZfGPX6p2CwOs0JGMPHu4KcoFwqO+ZEKYjgQD2AVaQbdokLjBfmR70/lLI bAsUU2F8/wu03wbNWxT4m/80F5BdomMllzd+2fTqvAulvFnKX3khzgEYpQjjnaTkUrVe SO27stZe+lOCna4jbPtzo0XfQRNZ80+eG6ogBecR/9zddP2wWGhwkTQLMStll9c5/ZDb 9usQ== X-Gm-Message-State: ALoCoQmTSMfbsGkFkD+paidiZRv8dE+VCj493/IwfHD21mi05iEjaSkFvoQZFBtoIfKhtTyNOVMA 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-head@freebsd.org X-Mailman-Version: 2.1.18 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: Tue, 22 Jul 2014 16:44:54 -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/