This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Missing sleep function for mingw hosts
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: Pedro Alves <pedro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org, Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>, Eli Zaretskii <eliz at gnu dot org>
- Date: Tue, 29 Mar 2011 16:28:28 +0200
- Subject: Re: [RFC] Missing sleep function for mingw hosts
- References: <E1Q4Y9z-0004UD-1Y@fencepost.gnu.org> <201103291523.46954.pedro@codesourcery.com>
2011/3/29 Pedro Alves <pedro@codesourcery.com>:
> On Tuesday 29 March 2011 14:00:32, Pierre Muller wrote:
>> ? Hi Eli,
>> > > I found that there is a substitute for sleep in gnulib:
>> > >
>> >
>> http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/sleep.c;hb=d60
>> > > f3b0c6b0f93a601acd1cfd3923f94ca05abb0
>> > >
>> > > ? What is the rule to add new parts into gnulib subdirectory?
>> > > Would inclusion of gnulib sleep.c source code
>> > > be possible to fix the above problem?
>> >
>> > I'd rather we had a replacement in win32-nat.c, instead of importing
>> > gobs of gnulib stuff needed to provide such a trivial replacement.
>> > gnulib is GPL, so we can simply copy the code into our sources.
>
> gnulib has a mechanism (which we are already using) where
> we just import the modules we need. ?We don't import the whole thing. ?We
> currently import the memmem module. ?We would just need to import the
> "sleep" module in addition (and whatever dependencies that
> may have --- which are handled automatically by gnulib's import script).
>
> I have no clue why that `sleep' is necessary, but in any case, can't
> we use already existing `gdb_usleep' function instead and be done
> with it?
>
> --
> Pedro Alves
>
Yes, this sounds to me like a good solution. The usleep function is
available for mingw runtime, so this looks simpler to me, too.
Regards,
Kai