open-cloexec.m4 723 B

123456789101112131415161718192021
  1. # Test whether O_CLOEXEC is defined.
  2. dnl Copyright 2017-2021 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. AC_DEFUN([gl_PREPROC_O_CLOEXEC],
  7. [
  8. AC_CACHE_CHECK([for O_CLOEXEC],
  9. [gl_cv_macro_O_CLOEXEC],
  10. [AC_COMPILE_IFELSE(
  11. [AC_LANG_PROGRAM([[#include <fcntl.h>
  12. #ifndef O_CLOEXEC
  13. choke me;
  14. #endif
  15. ]],
  16. [[return O_CLOEXEC;]])],
  17. [gl_cv_macro_O_CLOEXEC=yes],
  18. [gl_cv_macro_O_CLOEXEC=no])])
  19. ])