[tlbuild] tl09 build status

Ken Brown kbrow1i at gmail.com
Wed Jun 3 13:19:12 CEST 2009


On 6/3/2009 3:18 AM, Taco Hoekwater wrote:
>> Ken Brown wrote:
>>> On 6/2/2009 9:05 AM, Peter Breitenlohner wrote:
>>>> They are for cygwin-1.7 so I couldn't check all details. On our
>>>> cygwin-1.5
>>>> /usr/include/fcntl.h defines
>>>>   _O_BINARY -> O_BINARY -> _FBINARY -> 0x10000
>>>>   _O_TEXT   -> O_TEXT   -> _FTEXT   -> 0x20000
>>> It's the same in cygwin-1.7 (but the defines are now in
>>> /usr/include/sys/_default_fcntl.h).
> I need a little help for this.
> 
> The code in lfs.c tests whether it is compiling for windows by looking
> at the _WIN32 predefine. Cygwin does *not* define this symbol, but it
> *does* define the file mode variables, which is a bit contradictory,
> so now I have a short set of questions:

Hi Taco,

I'm not a programmer and can't immediately answer all your questions. 
But I think I can tell you enough.

I would be very surprised if you needed to add special code to test for 
cygwin.  Cygwin tries to emulate linux to the extent that it can, and it 
has moved even further in that direction with cygwin-1.7.  So chances 
are that everything will be fine if you just use some simple method of 
making the warnings go away.

I think cygwin defines the file mode variables for compatibility with 
programs that want to make the windows-like distinction between text 
files and binary files, but the cygwin developers discourage doing this. 
  There are a couple of comments in /usr/include/sys/_default_fcntl.h 
that might help clarify this:

/* For machines which care - */
#if defined (_WIN32) || defined (__CYGWIN__)
#define _FBINARY        0x10000
#define _FTEXT          0x20000
[...]
#define O_BINARY	_FBINARY
#define O_TEXT		_FTEXT
[...]
/* The windows header files define versions with a leading underscore.  */
[...]
#define _O_TEXT		O_TEXT
#define _O_BINARY	O_BINARY

>   Which of the WIN32 preprocessor symbols *are* defined by Cygwin,
>   if any? In particular, can I use __WIN32? Or is there __CYGWIN
>   or something like that?

I think this is answered above.

> And then a short series of unclarities. These are all probably
> U (=unix) otherwise there would have been more errors and warnings,
> but just to be sure:
> 
>   Does Cygwin have 'struct stat' (U) or 'struct _stati64' (W)?
>   Does Cygwin have fcntl (U) or _locking (W) file locking ?
>   Does Cygwin have mkdir(A) (W) or mkdir(A,mode) (U)?
>   Does Cygwin do readdir(U) or  _findfirst (W) dir iteration?

I don't know for sure, but it's a good bet that cygwin uses the unix 
versions.

> The next one I really don't know: the existance of S_ISLNK doesn't
> mean much unless it is supported by the file system:
> 
>   Does Cygwin really have symlinks?

Yes.

> And most important:
> 
>   Does Cygwin have the _setmode (W) function or not?
>   If yes, is this the correct prototype?
 >
 >      int _setmode (int fd, int mode );

In view of everything I've said above, I hope this is no longer 
relevant.  (I'm assuming this is something that's windows-specific and 
would not normally be used in a program intended for a unix-like 
system.)  But if you still need to know, please tell me how I can find 
out.  Is there a simple test program I can try to compile?

Regards,

Ken


More information about the tlbuild mailing list