discover nanosleep() availability in configure
parent
4063cb317a
commit
d688f23f03
|
@ -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(). */
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue