www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2016/04/25/12:48:22

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
RazorGate-KAS: Status: not_detected
RazorGate-KAS: Rate: 0
RazorGate-KAS: Envelope from:
RazorGate-KAS: Version: 5.5.3
RazorGate-KAS: LuaCore: 215 2015-05-29_17-31-22
60ae4a1b4d01d14f868b20a55aced8d7df7b2e28
RazorGate-KAS: Lua profiles 78662 [Jun 02 2015]
RazorGate-KAS: Method: none
Subject: Re: Fwd: A few DJGPP libc.a bugs
To: djgpp-workers AT delorie DOT com
References: <56F8295E DOT 2090401 AT posteo DOT de> <571E403D DOT 8080709 AT iki DOT fi>
From: "Andris Pavenis (andris DOT pavenis AT iki DOT fi) [via djgpp-workers AT delorie DOT com]" <djgpp-workers AT delorie DOT com>
Message-ID: <571E4A50.3010806@iki.fi>
Date: Mon, 25 Apr 2016 19:48:16 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
Thunderbird/38.7.1
MIME-Version: 1.0
In-Reply-To: <571E403D.8080709@iki.fi>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

This is a multi-part message in MIME format.
--------------050408070503050905030607
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

On 04/25/2016 07:05 PM, Andris Pavenis (andris DOT pavenis AT iki DOT fi) [via djgpp-workers AT delorie DOT com] wrote:
>
> Sent to me privately. I suggested author to send it to list. I have not seen however any activity 
> since that.
> So I'm forwarding message to list.
>
> I'm also committing the proposed patch for ttyscrn.c.
>

Problem with fseeko64() confirmed. Test example in attachment.
fseek() works OK in this example, fseeko64() do not

Andris


--------------050408070503050905030607
Content-Type: text/x-c++src;
 name="fseeko64_test.cpp"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="fseeko64_test.cpp"

#include <cstdio>
#include <cstring>
#include <iostream>

int test1(bool useFseeko64)
{
        int numErr = 0;
	char b1[8192], b2[4096];
	FILE* input = std::fopen("/dev/env/DJDIR/bin/gcc.exe", "rb");
	//FILE* input = std::fopen("d:/djgpp/bin/gcc.exe", "rb");
	std::fread(b1, 8192, 1, input);
        for (int off = 0; off < 4095; off += 17) {
                if (useFseeko64) {
			fseeko64(input, off, SEEK_SET);
		} else {
			fseek(input, off, SEEK_SET);
		}
		std::fread(b2, 4096, 1, input);
		if (std::memcmp(b1 + off, b2, 4096) != 0) {
			numErr++;
		}
	}
	return numErr;
}

int main(void)
{
	std::cout << "fseek: " << test1(false) << " errors found" << std::endl;
	std::cout << "fseeko64: " << test1(true) << " errors found" << std::endl;
	return 0;
}

--------------050408070503050905030607--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019