lzip-bug
[Top][All Lists]
Advanced

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

Re: [Lzip-bug] Re: Version 1.11-rc2 of lzip released


From: JonY
Subject: Re: [Lzip-bug] Re: Version 1.11-rc2 of lzip released
Date: Sun, 01 Aug 2010 07:37:07 +0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.0

On 8/1/2010 01:03, Antonio Diaz Diaz wrote:
JonY wrote:
Setting to stdin and stdout implicitly to binary mode at the beginning
of main solved the problems. Something like:

int main( const int argc, const char * const argv[] )
{
+ setmode(STDIN_FILENO, O_BINARY);
+ setmode(STDOUT_FILENO, O_BINARY);

Thanks. I have already uploaded rc3. I'll announce it tomorrow.


setmode looks to be available with OS/2 as well, but its unrelated to
BSD setmode.

Is there some "setmode" function common to Windows and OS/2? OS/2 seems
to use this:

+#ifdef __EMX__
+ _fsetmode( stdin, "b");
+ _fsetmode( stdout, "b");
+#endif


Sorry, no _fsetmode on win32. I can't seem to find OS/2 docs anywhere, but some ffmpeg discussion mentions setmode being available to OS/2 as well.

Elbert, care to comment?


I would consider adding a conditional for binary mode stdin/stdout, but
not litter the code with a conditional per system. Text mode is a
bug[1], not a feature.

[1] http://cygwin.com/faq.html
"Actually there's no really good reason to do text mode processing since
it only slows down reading and writing files".



IMHO, that was MS's bad decision for backwards compatibility.

There are some minor issues for win32 too, it doesn't have fchmod()
and fchown() and some other permission related macros. How should
these be dealt with in the long term?

In the short term I expect packagers to comment them out. ;-)

In the medium term I expect most "posix-like environments" (Cygwin,
MinGW) for non-posix systems will implement[2] (or at least fake) them.

[2] http://en.wikipedia.org/wiki/MinGW#Comparison_with_Cygwin
"Cygwin aims to provide a complete POSIX layer (similar to that found in
a Linux or other Unix systems) on top of Windows, sacrificing
performance where necessary for compatibility".


mingw developers would rave on how mingw is not posix and doesn't try to be posix, unless its adding minimalist support for its toolchain infrastructure.

Cygwin however performs flawlessly for lzip, it does try to be posix.

In the long term I hope non-posix systems will become posix-systems or
dissapear.


That would be nice. :)

But suggestions are welcome. :-)


None at the moment, unless you are willing to use autotools, or at least some compile tests in configure to find out if these functions are available.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]