#endif
+/* Define if O_NONBLOCK supported by fcntl. */
+#ifndef USED_FOR_TARGET
+#undef HOST_HAS_O_NONBLOCK
+#endif
+
+
/* Define which stat syscall is able to handle 64bit indodes. */
#ifndef USED_FOR_TARGET
#undef HOST_STAT_FOR_64BIT_INODES
fi
+# Check if O_NONBLOCK is defined by fcntl
+for ac_header in fcntl.h
+do :
+ ac_fn_cxx_check_header_preproc "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h"
+if test "x$ac_cv_header_fcntl_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_FCNTL_H 1
+_ACEOF
+
+fi
+done
+
+ac_fn_cxx_check_decl "$LINENO" "O_NONBLOCK" "ac_cv_have_decl_O_NONBLOCK" "#include <fcntl.h>
+"
+if test "x$ac_cv_have_decl_O_NONBLOCK" = xyes; then :
+
+fi
+
+if test $ac_cv_have_decl_O_NONBLOCK = yes; then
+
+$as_echo "#define HOST_HAS_O_NONBLOCK 1" >>confdefs.h
+
+fi
+
+
# C++ Modules would like some networking features to provide the mapping
# server. You can still use modules without them though.
# The following network-related checks could probably do with some
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 19681 "configure"
+#line 19706 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 19787 "configure"
+#line 19812 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
[Define if O_CLOEXEC supported by fcntl.])
fi
+# Check if O_NONBLOCK is defined by fcntl
+AC_CHECK_HEADERS([fcntl.h])
+AC_CHECK_DECL(O_NONBLOCK,,,[#include <fcntl.h>])
+if test $ac_cv_have_decl_O_NONBLOCK = yes; then
+ AC_DEFINE(HOST_HAS_O_NONBLOCK, 1,
+ [Define if O_NONBLOCK supported by fcntl.])
+fi
+
+
# C++ Modules would like some networking features to provide the mapping
# server. You can still use modules without them though.
# The following network-related checks could probably do with some
}
while (!WIFEXITED (status) && !WIFSIGNALED (status));
- --nruns;
+ --nruns;
- /* Return token to the jobserver if active. */
- if (jinfo != NULL && jinfo->is_active)
- jinfo->return_token ();
+ /* Return token to the jobserver if active. */
+ if (jinfo != NULL && jinfo->is_connected)
+ jinfo->return_token ();
}
#endif
streaming process. */
if (!last)
{
- if (jinfo != NULL && jinfo->is_active)
+ if (jinfo != NULL && jinfo->is_connected)
while (true)
{
if (jinfo->get_token ())
while (nruns > 0)
wait_for_child ();
- if (jinfo != NULL && jinfo->is_active)
+ if (jinfo != NULL && jinfo->is_connected)
jinfo->disconnect ();
}
asm_nodes_output = true;
jobserver_info::connect ()
{
if (!pipe_path.empty ())
- pipefd = open (pipe_path.c_str (), O_RDWR | O_NONBLOCK);
+ {
+#if HOST_HAS_O_NONBLOCK
+ pipefd = open (pipe_path.c_str (), O_RDWR | O_NONBLOCK);
+ is_connected = true;
+#else
+ is_connected = false;
+#endif
+ }
+ else
+ is_connected = true;
}
void
int pipefd = -1;
/* Return true if jobserver is active. */
bool is_active = false;
+ /* Return true if communication with jobserver is working. */
+ bool is_connected = false;
};
#endif /* GCC_JOBSERVER_H */