maint: update copyright
[gnulib.git] / m4 / nonblocking.m4
1 # nonblocking.m4 serial 2
2 dnl Copyright (C) 2011-2014 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 dnl Also tests whether open() supports O_NONBLOCK.
10 dnl Sets gl_cv_have_open_O_NONBLOCK.
11 AC_DEFUN([gl_NONBLOCKING_IO],
12 [
13   dnl Use AC_REQUIRE here, so that the default behavior below is expanded
14   dnl once only, before all statements that occur in other macros.
15   AC_REQUIRE([gl_NONBLOCKING_IO_BODY])
16 ])
17
18 AC_DEFUN([gl_NONBLOCKING_IO_BODY],
19 [
20   AC_REQUIRE([AC_CANONICAL_HOST])
21   case "$host_os" in
22     mingw*) gl_cv_have_nonblocking=no ;;
23     *)      gl_cv_have_nonblocking=yes ;;
24   esac
25   case "$host_os" in
26     mingw*) gl_cv_have_open_O_NONBLOCK=no ;;
27     *)      gl_cv_have_open_O_NONBLOCK=yes ;;
28   esac
29 ])