Support non-blocking pipe I/O in write() on native Windows.
[gnulib.git] / m4 / nonblocking.m4
1 # nonblocking.m4 serial 1
2 dnl Copyright (C) 2011 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl Tests whether non-blocking I/O is natively supported by read(), write().
8 dnl Sets gl_cv_have_nonblocking.
9 AC_DEFUN([gl_NONBLOCKING_IO],
10 [
11   dnl Use AC_REQUIRE here, so that the default behavior below is expanded
12   dnl once only, before all statements that occur in other macros.
13   AC_REQUIRE([gl_NONBLOCKING_IO_BODY])
14 ])
15
16 AC_DEFUN([gl_NONBLOCKING_IO_BODY],
17 [
18   AC_REQUIRE([AC_CANONICAL_HOST])
19   case "$host_os" in
20     mingw*) gl_cv_have_nonblocking=no ;;
21     *)      gl_cv_have_nonblocking=yes ;;
22   esac
23 ])