(libf2c) libu77 win32 dtime/etime fix

Mumit Khan khan@xraylith.wisc.edu
Tue Apr 13 13:47:00 GMT 1999


On 13 Apr 1999, Dave Love wrote:

> >>>>> "MK" == Mumit Khan <khan@xraylith.wisc.EDU> writes:
> 
>  MK> My last posting, which did not include Tim's fix, never made it
>  MK> in.  Dave Love had been away and Craig probably too busy with
>  MK> other things, so here it is again.
> 
> Well I couldn't approve or reject it, but I still think doing it this
> way is wrong.  You now have the standard SYSTEM_CLOCK inconsistent (I
> assume) with the non-standard [DE]TIME and some fairly obscure stuff
> to someone who doesn't know DozeN'T/Doze9x without commentary in two
> places (so far) with system tests rather than feature tests.

Oops, I forgot to cvs diff SYSTEM_CLOCK when I made the patch. I'll 
however wait until we come to some sort of understanding. See below.

> If the system libraries are duff -- I don't recall the story if I knew
> it -- why won't it work to provide a functional version of `times'
> (say) and autoconfiscate in the standard manner?

Ok, here's a short version of the story ...

When you read this, please keep in mind that ANSI specifies neither
times() nor getrusage().

There are a total 3 different supported windows32 targets:

Mingw32 -- uses MS runtime. No POSIX times() nor BSD getrusage().See [1]
Cygwin  -- uses Cygnus POSIX runtime. Have times(). See [2]
UWIN    -- uses AT&T POSIX runtime. Have times(). See [2]

[1] To support mingw32, we obviously need to write something usable
ourselves using the underlying system API. Essentially that's the code
you see withing the #ifdef _WIN32 ... #endif.

[2] Both Cygwin and UWIN implement the POSIX times(), and normally we
could just use that since autoconf detects it. The trouble is that
times() is implemented using a win32 API routine that is a stub in 
Windows95 but works correctly in NT. Unless you're autoconfiguring
on the same machine that the excutable linked against libf2c is going 
to run on, there is no way to do this correctly.

My implementation covers *all* windows32 implementations. Even if
Cygwin and UWIN runtimes did provide fixed versions of times(), we
would *still* need the code for Mingw32 if we wanted to support it.

Here's what I'm quite willing to do: provide a times()-like function 
that goes in libU77 and only picked up for certain affected targets 
by autoconf. This will be the code within #ifdef _WIN32 ... #endif.

The other choice is to say that libf2c will not support targets that
do not provide either working times or getrusage ...

Regards,
Mumit




More information about the Gcc-patches mailing list