Time zone confusion and implementation hints

Guy Harris guy at alum.mit.edu
Tue Jul 6 16:51:28 UTC 2010

On Jul 6, 2010, at 8:55 AM, Yves Goergen wrote:

> I have now tried to compile it with MinGW using the makefile but it
> doesn't work either. Here's the output:
>> C:\Programme\MinGW\tz>mingw32-make
>> makefile:306: warning: overriding commands for target `install'
>> makefile:287: warning: ignoring old commands for target `install'
>> sed \
>>                        -e 's|AWK=[^}]*|AWK=nawk|g' \
>>                        -e 's|TZDIR=[^}]*|TZDIR=/usr/local/etc/zoneinfo|' \
>>                        <tzselect.ksh >tzselect
>> chmod +x tzselect
>> process_begin: CreateProcess(NULL, chmod +x tzselect, ...) failed.
>> make (e=2): Das System kann die angegebene Datei nicht finden.
>> mingw32-make: *** [tzselect] Error 2
> (The second-last line says: The system cannot find the specified file.)

The specified file might be chmod; that command is marking the tzselect command as executable - it's a shell script, so that's necessary.

> On 06.07.2010 17:16 CE(S)T, lennox at cs.columbia.edu wrote:
>> zic uses the low-level POSIX file I/O calls (open/read/write) rather than
>> the high-level C file I/O calls (fopen/fread/fwrite)
> POSIX shouldn't be too much of a problem on Windows, AFAIK it offers
> such an API.

The high-level C file I/O calls are offered, of course; I don't remember why we didn't use it.

The low-level equivalents of open(), read(), and write() in Windows are CreateFile(), ReadFile(), and WriteFile().  (In UN*X, you create files with open(); in Windows, you open files with CreateFile(). :-))

> IIRC with VS2008 it was functions like _getopt or so that were
> eventually unresolved which caused the linker to fail.

getopt() is oriented towards the UN*X command-line option conventions, and isn't part of the C standard.  Wireshark uses the GNU libc version of getopt() on Windows; the BSD version might also work if the GNU Public License is a problem.

More information about the tz mailing list