Re: Re: GNULib Module gettime Breaks CVS Build On Windows

Paul Eggert <[email protected]> Sun, 16 May 2004 14:36:17 -0700
Newsgroups gmane.comp.lib.gnulib.bugs,gmane.comp.version-control.cvs.bugs
Message-ID <[email protected]>
Derek Robert Price <[email protected]> writes:

> Would it be worthwhile to test for whether the second arg appears to
> contain a garbage return via nanosleep.m4 and move the switched
> gettime wrapper functionality into nanosleep.m4 itself?

I didn't quite follow your suggestion, but if it means to have
rpl_nanosleep "do the right thing" even if the kernel's nanosleep is
buggy, then yes, that sounds like a good thing.  It'd be some work
though, as it'd need to be done even if the kernel doesn't have a
nanosleep function.

> I would assume an alarm (1 second), nanosleep (5 seconds), check 2nd
> arg value is close to 4 seconds would do the trick?

Yes.  (Cross-compilation should assume it doesn't work.)

> Alternately, [nanosleep.c] could declare the select prototype and
> the struct timeval when !HAVE_<needed_headers>, but that seems more
> complicated to me.

Yes, it's more complicated if all we care about is Windows, but it
sounds like a better approach for porting to other random hosts so I'd
prefer that.  Autoconf's AC_FUNC_SELECT_ARGTYPES is designed for this
sort of thing; perhaps we should be using that.