From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10871 invoked from network); 11 Aug 2022 11:36:53 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 11 Aug 2022 11:36:53 -0000 Received: (qmail 30138 invoked by uid 550); 11 Aug 2022 11:36:50 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 30118 invoked from network); 11 Aug 2022 11:36:49 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660217798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dMZgejLp6leNpzqPrGXxge8dwWOloPeD8Sd1AM1cfYE=; b=LRPpXWkfmtLf+FX2li+MWvBcmjXjmOdKY90U41hsynqVYgu9eFWEb4PrMrcnIok3uJzvVK bQkQQPDw1KjaR22DufyENimEZuY+ISq4ff6iqXUTlnrYZhiQFKqFU/WPUkKJ8sB3dv2Qjp T6I/TjABpg0pcaSqnf8+JYX5spPFkl8= X-MC-Unique: lPlKji2oO4u6aDZP_X-ENw-1 From: Florian Weimer To: "Buchholz, Robert" Cc: "musl@lists.openwall.com" References: Date: Thu, 11 Aug 2022 13:36:33 +0200 In-Reply-To: (Robert Buchholz's message of "Thu, 11 Aug 2022 11:14:09 +0000") Message-ID: <87tu6jt3jy.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Subject: Re: [musl] Bug: ftell() after fopen(..., "ab") returns 0 unless an explicit fseek() is used first * Robert Buchholz: > On my Alpine/MUSL setup this prints "0 6" while on Ubuntu 22.04 with > glibc it prints "3 6" - which I'm assuming is the expected output. Both behaviors are acceptable. C11 (7.21.3p1) says this: | If a file can support positioning requests (such as a disk file, as | opposed to a terminal), then a file position indicator associated with | the stream is positioned at the start (character number zero) of the | file, unless the file is opened with append mode in which case it is | implementation-defined whether the file position indicator is initially | positioned at the beginning or the end of the file. musl is likely not the only libc with this type of behavior, given that it's explicitly allowed by the standard. Thanks, Florian