CPU usage of nanosleep on Win32 when called repeatedly

2011-11-21 Thread Michael Goffioul
Hi, In the context of octave, I need to have a loop that sleeps for about 100ms then perform some action. Most of the time, the action to perform is empty so the loop is mainly sleeping. I don't expect such loop to be CPU-consuming. To build this loop in octave, I'm using octave_usleep, which call

Re: [PATCH] getcwd-lgpl: fix m4 to match relaxed test for BSD

2011-11-21 Thread Jim Meyering
Bruno Haible wrote: > Eric Blake wrote on 2011-08-17: >> gl_FUNC_GETCWD_ABORT_BUG([gl_abort_bug=yes]);; >>esac >> >> - case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_path_max,$gl_abort_bug in >> - *yes,yes,no) ;; >> + case >> $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature$

Re: declare sethostname if unistd.h doesn't

2011-11-21 Thread Simon Josefsson
Ben Walton writes: > Excerpts from Simon Josefsson's message of Sun Nov 20 14:04:42 -0500 2011: > > Hi Simon, > >> Have you tested that it resolves the portability issue? If so that is >> great. My man page says Solaris uses this prototype: >> >> int sethostname(char *name, int namelen);

Re: [PATCH] getcwd-lgpl: fix m4 to match relaxed test for BSD

2011-11-21 Thread Bruno Haible
Hi Jim, > > This change has the effect of setting REPLACE_GETCWD to 1 on *all* > > platforms. A string with only two commas can never math the pattern > > "*yes,yes,yes,no". > > Obviously a typo. Yes, sure. > > Such as on glibc 2.11/Linux or MacOS X or FreeBSD 6.4, OpenBSD 4.9, NetBSD > > 5.1:

Re: Failed test on Solaris 8 Sparc

2011-11-21 Thread Simon Josefsson
Dagobert Michelsen writes: > Hi Simon, > > Am 21.04.2010 um 08:36 schrieb Simon Josefsson: >> Dagobert Michelsen writes: >>> Am 31.03.2009 um 12:23 schrieb Simon Josefsson: Dagobert Michelsen writes: > I am getting a test failure on Solaris 8 Sparc w/Sun Studio 11: Hi! Thank

Re: [PATCH] getcwd-lgpl: fix m4 to match relaxed test for BSD

2011-11-21 Thread Jim Meyering
Bruno Haible wrote: ... >> > So, what should we do? >> > - Change m4/getcwd-abort-bug.m4 to consider an exit code 4 also to be a >> > failure? >> > - Or change tests/test-getcwd.c to consider test_abort_bug() = 4 a >> > success >> > and change the documentation to state that getcwd(NUL

gnulib-common config.h snippet's use of _MSC_VER

2011-11-21 Thread Simon Josefsson
All, The file gnulib-common contains some code that ends up in config.h and thus gets included into all source files, and it looks like this: #ifndef _Noreturn # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ || 0x5110 <= __SUNPRO_C) # define _Noreturn __attribute__ ((__nore

Re: gnulib-common config.h snippet's use of _MSC_VER

2011-11-21 Thread Bruno Haible
Hi Simon, > I understand that gnulib's code isn't clean against -Wundef in general, > however I believe code that gnulib puts into config.h should meet a > higher standard OK. > +2011-11-21 Simon Josefsson > + > + * m4/gnulib-common.m4 (_Noreturn): Check that _MSC_VER is defined > + b

Re: Failed test on Solaris 8 Sparc

2011-11-21 Thread Bruno Haible
Simon Josefsson wrote: > >> Unconnected socket test... passed > >> Connected sockets test... failed (expecting POLLHUP after shutdown) > >> General socket test with fork... failed (expecting POLLHUP after > >> shutdown) > >> FAIL: test-poll > ... > we'll use the latest gnulib an

Re: gnulib-common config.h snippet's use of _MSC_VER

2011-11-21 Thread Simon Josefsson
Bruno Haible writes: > Hi Simon, > >> I understand that gnulib's code isn't clean against -Wundef in general, >> however I believe code that gnulib puts into config.h should meet a >> higher standard > > OK. > >> +2011-11-21 Simon Josefsson >> + >> +* m4/gnulib-common.m4 (_Noreturn): Check

Re: grep-2.10 on OSF/1

2011-11-21 Thread Eric Blake
[adding bug-gnulib] How about having compare "know" about /dev/null. Then it can perform the test -s and warn if the file is nonempty. With that, all existing (and there are many) /dev/null-using compare uses will benefit. >> >> Nice idea. > Yes. In fact, c-set was against gn

Re: init.sh compare function

2011-11-21 Thread Bruno Haible
[dropping bug-grep from CC] > > --- a/tests/init.sh > > +++ b/tests/init.sh > > @@ -221,11 +221,35 @@ export MALLOC_PERTURB_ > > # a partition, or to undo any other global state changes. > > cleanup_ () { :; } > > > > +# Arrange not to let diff or cmp operate on /dev/null, > > +# since on some