summaryrefslogtreecommitdiff
path: root/m4/open.m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-04-19 10:38:30 +0200
committerBruno Haible <bruno@clisp.org>2011-04-19 10:38:30 +0200
commit12856373f8fd28a9d4453d6df97b2fdd17ced398 (patch)
tree7db287a79567ebffbc8bf225499d8dac7e742308 /m4/open.m4
parent05414bd22e5c18afd876aa481fb6648458bad6b5 (diff)
downloadgnulib-12856373f8fd28a9d4453d6df97b2fdd17ced398.tar.gz
Move the support of O_NONBLOCK in open() to the 'open' module.
* modules/nonblocking (Depends-on): Remove 'open'. * m4/nonblocking.m4 (gl_NONBLOCKING_IO_BODY): Set gl_cv_have_open_O_NONBLOCK. * m4/open.m4 (gl_FUNC_OPEN): Replace open() also when required for O_NONBLOCK support. * doc/posix-functions/open.texi: Document support for O_NONBLOCK.
Diffstat (limited to 'm4/open.m4')
-rw-r--r--m4/open.m411
1 files changed, 10 insertions, 1 deletions
diff --git a/m4/open.m4 b/m4/open.m4
index bfebdab7b6..690cc648d0 100644
--- a/m4/open.m4
+++ b/m4/open.m4
@@ -1,4 +1,4 @@
-# open.m4 serial 11
+# open.m4 serial 12
dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -62,6 +62,15 @@ changequote([,])dnl
esac
;;
esac
+ dnl Replace open() for supporting the gnulib-defined O_NONBLOCK flag.
+ m4_ifdef([gl_NONBLOCKING_IO], [
+ if test $REPLACE_OPEN = 0; then
+ gl_NONBLOCKING_IO
+ if test $gl_cv_have_open_O_NONBLOCK != yes; then
+ gl_REPLACE_OPEN
+ fi
+ fi
+ ])
])
AC_DEFUN([gl_REPLACE_OPEN],