bug-cvs
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] Re: GNULib Module gettime Breaks CVS Build On Windows


From: Paul Eggert
Subject: Re: [Bug-gnulib] Re: GNULib Module gettime Breaks CVS Build On Windows
Date: Sat, 15 May 2004 23:39:13 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Derek Robert Price <address@hidden> writes:

> I've also added my_usleep & nanosleep functions to
> windows-NT/woe32.c.  They are mostly duplicated code from nanosleep.c,
> so I'm tempted to fork our nanosleep.c to include the #include
> <winsock.h> instead and ease maintenence, but it's somewhat debatable
> whether that is easier since it would complicate updates from GNULIB.


I'd like to mention a couple of things about gnulib nanosleep.

First, the gnulib nanosleep isn't a complete replacement for
nanosleep.  It might not sleep long enough (even when not
interrupted), due to limitations in the underlying primitives.  Also,
it returns garbage in its 2nd arg.  coreutils (the only other user of
gnulib nanosleep, as far as I know) is immune to both of these
problems, since it uses a wrapper (called xnanosleep) that works
around them.  Is CVS similar?  If not, perhaps xnanosleep should be
added to gnulib, and CVS should use that.  (Note that many versions of
the Linux kernel return garbage in nanosleep's 2nd arg, so something
like xnanosleep is necessary for them too....)

Second, if the only reason CVS is using nanosleep is to have a
fine-grained sleep, and if the Windows platform has a usleep function
compatible with POSIX's obsolescent usleep API
(<http://www.opengroup.org/onlinepubs/009695399/functions/usleep.html>),
then it wouldn't be hard to add support for that to gnulib nanosleep,
so that gnulib nanosleep would use sleep+usleep if available.

PS.  I don't see gnulib nanosleep.c in CVS 1.12.7 so I'm a bit lost as
to where CVS is using it.

PPS.  POSIX says that one must include <sys/select.h> before using
select so I guess gnulib nanosleep.c should have that change
regardless of the other changes being discussed.




reply via email to

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