discover nanosleep() availability in configure

master
Hannes Mehnert 2016-05-14 12:39:28 +01:00 committed by Gabriel Scherer
parent 4063cb317a
commit d688f23f03
3 changed files with 9 additions and 1 deletions

View File

@ -130,6 +130,9 @@
/* Define HAS_SYS_SELECT_H if /usr/include/sys/select.h exists
and should be included before using select(). */
#define HAS_NANOSLEEP
/* Define HAS_NANOSLEEP if you have nanosleep(). */
#define HAS_SYMLINK
/* Define HAS_SYMLINK if you have symlink() and readlink() and lstat(). */

5
configure vendored
View File

@ -1230,6 +1230,11 @@ if sh ./hasgot select && \
has_select=yes
fi
if sh ./hasgot nanosleep ; then
inf "nanosleep() found."
echo "#define HAS_NANOSLEEP" >> s.h
fi
if sh ./hasgot symlink readlink lstat; then
inf "symlink() found."
echo "#define HAS_SYMLINK" >> s.h

View File

@ -31,7 +31,7 @@ CAMLprim value unix_sleep(value duration)
{
double d = Double_val(duration);
if (d <= 0.0) return Val_unit;
#if _POSIX_C_SOURCE >= 199309L
#if defined(HAS_NANOSLEEP)
{
struct timespec t;
int ret;