Re: [PATCH] Add a new lstat and fstat implementation based on Win32 API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marius Storm-Olsen schrieb:
Johannes Sixt said the following on 04.09.2007 09:41:
Thanks a lot! I've pushed it out in mingw.git's master.

Ops, already in master branch?

Yes, it looked so polished ;)

http://repo.or.cz/w/git/mingw/4msysgit.git?a=commitdiff;h=f15974add93bdfa92775c77c00e7c65aefd42127

Looks good, although you should now handle INVALID_HANDLE_VALUE at the beginning of git_fstat() like this:

	HANDLE fh = (HANDLE)_get_osfhandle(fd);
	if (fh == INVALID_HANDLE_VALUE)
		return -1;	/* errno has been set */

	if (GetFileInformationByHandle(...

Ok, I can give it a performance test, but I tend to agree with David Kastrup there. It would be better if we rather fix the places where we check with the local timestamp instead; depending of course on how many places we actually do this. We'll see how much the timezone conversion in the custom stat functions actually hurt us performance wise.

I'd make the decision on the grounds of a perfomance test. If it turns out that the penalty is bearable, we should keep this stuff private to the MinGW build. Otherwise, we would need MinGW specific code at the call sites (unless we can hide the opposite conversion in some other wrapper function).

... time passes ...

Ok, I just tested FileTimeToLocalFileTime() in a tight loop, and I can run it 100,000,000 times per second. So I'm confident that there won't be any noticable degradation with my proposed change.

-- Hannes
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux