diff options
| author | Paul Eggert | 2017-08-16 13:55:46 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-08-16 14:04:33 -0700 |
| commit | 794c3cd3a2dfcedc829ccb5dc413c99fb670f4a1 (patch) | |
| tree | 728839628834cbd80dc3bd8f795e9a5598fdffaf /m4 | |
| parent | 69f2b755f44a5e447b3ad482ce0b409764fa10e6 (diff) | |
| download | emacs-794c3cd3a2dfcedc829ccb5dc413c99fb670f4a1.tar.gz emacs-794c3cd3a2dfcedc829ccb5dc413c99fb670f4a1.zip | |
Merge from Gnulib; use ‘open’ for O_CLOEXEC
This incorporates:
2017-08-15 renameat: ensure declaration in <stdio.h> on NetBSD
2017-08-15 extensions: enable NetBSD specific extensions
2017-08-14 open: support O_CLOEXEC
2017-08-13 reallocarray: new module
* admin/merge-gnulib (AVOIDED_MODULES): Remove ‘open’, since
it now supports O_CLOEXEC and this simplifies Emacs.
* build-aux/config.guess, lib/fcntl.in.h, lib/stdio.in.h:
* lib/stdlib.in.h, m4/extensions.m4, m4/stdlib_h.m4:
Copy from Gnulib.
* lib/cloexec.c, lib/cloexec.h, lib/open.c:
* m4/mode_t.m4, m4/open-cloexec.m4, m4/open.m4:
New files, copied from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib-src/etags.c (O_CLOEXEC) [WINDOWSNT]:
Remove, as Gnulib does this for us.
* src/filelock.c (create_lock_file):
* src/sysdep.c (emacs_open, emacs_pipe):
Don’t worry about O_CLOEXEC == 0, as Gnulib no longer sets it to 0.
Diffstat (limited to 'm4')
| -rw-r--r-- | m4/extensions.m4 | 7 | ||||
| -rw-r--r-- | m4/gnulib-comp.m4 | 35 | ||||
| -rw-r--r-- | m4/mode_t.m4 | 26 | ||||
| -rw-r--r-- | m4/open-cloexec.m4 | 21 | ||||
| -rw-r--r-- | m4/open.m4 | 95 | ||||
| -rw-r--r-- | m4/stdlib_h.m4 | 8 |
6 files changed, 188 insertions, 4 deletions
diff --git a/m4/extensions.m4 b/m4/extensions.m4 index 0c16bb832f8..f8543386795 100644 --- a/m4/extensions.m4 +++ b/m4/extensions.m4 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # serial 16 -*- Autoconf -*- | 1 | # serial 17 -*- Autoconf -*- |
| 2 | # Enable extensions on systems that normally disable them. | 2 | # Enable extensions on systems that normally disable them. |
| 3 | 3 | ||
| 4 | # Copyright (C) 2003, 2006-2017 Free Software Foundation, Inc. | 4 | # Copyright (C) 2003, 2006-2017 Free Software Foundation, Inc. |
| @@ -68,6 +68,10 @@ dnl configure.ac when using autoheader 2.62. | |||
| 68 | #ifndef _GNU_SOURCE | 68 | #ifndef _GNU_SOURCE |
| 69 | # undef _GNU_SOURCE | 69 | # undef _GNU_SOURCE |
| 70 | #endif | 70 | #endif |
| 71 | /* Enable NetBSD extensions on NetBSD. */ | ||
| 72 | #ifndef _NETBSD_SOURCE | ||
| 73 | # undef _NETBSD_SOURCE | ||
| 74 | #endif | ||
| 71 | /* Enable OpenBSD extensions on NetBSD. */ | 75 | /* Enable OpenBSD extensions on NetBSD. */ |
| 72 | #ifndef _OPENBSD_SOURCE | 76 | #ifndef _OPENBSD_SOURCE |
| 73 | # undef _OPENBSD_SOURCE | 77 | # undef _OPENBSD_SOURCE |
| @@ -132,6 +136,7 @@ dnl configure.ac when using autoheader 2.62. | |||
| 132 | AC_DEFINE([_ALL_SOURCE]) | 136 | AC_DEFINE([_ALL_SOURCE]) |
| 133 | AC_DEFINE([_DARWIN_C_SOURCE]) | 137 | AC_DEFINE([_DARWIN_C_SOURCE]) |
| 134 | AC_DEFINE([_GNU_SOURCE]) | 138 | AC_DEFINE([_GNU_SOURCE]) |
| 139 | AC_DEFINE([_NETBSD_SOURCE]) | ||
| 135 | AC_DEFINE([_OPENBSD_SOURCE]) | 140 | AC_DEFINE([_OPENBSD_SOURCE]) |
| 136 | AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) | 141 | AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) |
| 137 | AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__]) | 142 | AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__]) |
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index d1089860e19..13504a8ca20 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 | |||
| @@ -53,6 +53,7 @@ AC_DEFUN([gl_EARLY], | |||
| 53 | # Code from module c-strcase: | 53 | # Code from module c-strcase: |
| 54 | # Code from module careadlinkat: | 54 | # Code from module careadlinkat: |
| 55 | # Code from module clock-time: | 55 | # Code from module clock-time: |
| 56 | # Code from module cloexec: | ||
| 56 | # Code from module close-stream: | 57 | # Code from module close-stream: |
| 57 | # Code from module count-leading-zeros: | 58 | # Code from module count-leading-zeros: |
| 58 | # Code from module count-one-bits: | 59 | # Code from module count-one-bits: |
| @@ -115,6 +116,7 @@ AC_DEFUN([gl_EARLY], | |||
| 115 | # Code from module multiarch: | 116 | # Code from module multiarch: |
| 116 | # Code from module nocrash: | 117 | # Code from module nocrash: |
| 117 | # Code from module nstrftime: | 118 | # Code from module nstrftime: |
| 119 | # Code from module open: | ||
| 118 | # Code from module openat-h: | 120 | # Code from module openat-h: |
| 119 | # Code from module pipe2: | 121 | # Code from module pipe2: |
| 120 | # Code from module pselect: | 122 | # Code from module pselect: |
| @@ -413,6 +415,7 @@ AC_DEFUN([gl_INIT], | |||
| 413 | gl_UTIMENS | 415 | gl_UTIMENS |
| 414 | AC_C_VARARRAYS | 416 | AC_C_VARARRAYS |
| 415 | gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=false | 417 | gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=false |
| 418 | gl_gnulib_enabled_cloexec=false | ||
| 416 | gl_gnulib_enabled_dirfd=false | 419 | gl_gnulib_enabled_dirfd=false |
| 417 | gl_gnulib_enabled_dosname=false | 420 | gl_gnulib_enabled_dosname=false |
| 418 | gl_gnulib_enabled_euidaccess=false | 421 | gl_gnulib_enabled_euidaccess=false |
| @@ -422,6 +425,7 @@ AC_DEFUN([gl_INIT], | |||
| 422 | gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=false | 425 | gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=false |
| 423 | gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9=false | 426 | gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9=false |
| 424 | gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=false | 427 | gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=false |
| 428 | gl_gnulib_enabled_open=false | ||
| 425 | gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=false | 429 | gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=false |
| 426 | gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false | 430 | gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false |
| 427 | gl_gnulib_enabled_strtoll=false | 431 | gl_gnulib_enabled_strtoll=false |
| @@ -431,6 +435,14 @@ AC_DEFUN([gl_INIT], | |||
| 431 | if ! $gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b; then | 435 | if ! $gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b; then |
| 432 | AC_LIBOBJ([openat-proc]) | 436 | AC_LIBOBJ([openat-proc]) |
| 433 | gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=true | 437 | gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=true |
| 438 | func_gl_gnulib_m4code_open | ||
| 439 | fi | ||
| 440 | } | ||
| 441 | func_gl_gnulib_m4code_cloexec () | ||
| 442 | { | ||
| 443 | if ! $gl_gnulib_enabled_cloexec; then | ||
| 444 | gl_MODULE_INDICATOR_FOR_TESTS([cloexec]) | ||
| 445 | gl_gnulib_enabled_cloexec=true | ||
| 434 | fi | 446 | fi |
| 435 | } | 447 | } |
| 436 | func_gl_gnulib_m4code_dirfd () | 448 | func_gl_gnulib_m4code_dirfd () |
| @@ -536,6 +548,21 @@ AC_DEFUN([gl_INIT], | |||
| 536 | gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=true | 548 | gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=true |
| 537 | fi | 549 | fi |
| 538 | } | 550 | } |
| 551 | func_gl_gnulib_m4code_open () | ||
| 552 | { | ||
| 553 | if ! $gl_gnulib_enabled_open; then | ||
| 554 | gl_FUNC_OPEN | ||
| 555 | if test $REPLACE_OPEN = 1; then | ||
| 556 | AC_LIBOBJ([open]) | ||
| 557 | gl_PREREQ_OPEN | ||
| 558 | fi | ||
| 559 | gl_FCNTL_MODULE_INDICATOR([open]) | ||
| 560 | gl_gnulib_enabled_open=true | ||
| 561 | if test $REPLACE_OPEN = 1; then | ||
| 562 | func_gl_gnulib_m4code_cloexec | ||
| 563 | fi | ||
| 564 | fi | ||
| 565 | } | ||
| 539 | func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7 () | 566 | func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7 () |
| 540 | { | 567 | { |
| 541 | if ! $gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7; then | 568 | if ! $gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7; then |
| @@ -622,6 +649,7 @@ AC_DEFUN([gl_INIT], | |||
| 622 | fi | 649 | fi |
| 623 | m4_pattern_allow([^gl_GNULIB_ENABLED_]) | 650 | m4_pattern_allow([^gl_GNULIB_ENABLED_]) |
| 624 | AM_CONDITIONAL([gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b], [$gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b]) | 651 | AM_CONDITIONAL([gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b], [$gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b]) |
| 652 | AM_CONDITIONAL([gl_GNULIB_ENABLED_cloexec], [$gl_gnulib_enabled_cloexec]) | ||
| 625 | AM_CONDITIONAL([gl_GNULIB_ENABLED_dirfd], [$gl_gnulib_enabled_dirfd]) | 653 | AM_CONDITIONAL([gl_GNULIB_ENABLED_dirfd], [$gl_gnulib_enabled_dirfd]) |
| 626 | AM_CONDITIONAL([gl_GNULIB_ENABLED_dosname], [$gl_gnulib_enabled_dosname]) | 654 | AM_CONDITIONAL([gl_GNULIB_ENABLED_dosname], [$gl_gnulib_enabled_dosname]) |
| 627 | AM_CONDITIONAL([gl_GNULIB_ENABLED_euidaccess], [$gl_gnulib_enabled_euidaccess]) | 655 | AM_CONDITIONAL([gl_GNULIB_ENABLED_euidaccess], [$gl_gnulib_enabled_euidaccess]) |
| @@ -631,6 +659,7 @@ AC_DEFUN([gl_INIT], | |||
| 631 | AM_CONDITIONAL([gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1], [$gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1]) | 659 | AM_CONDITIONAL([gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1], [$gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1]) |
| 632 | AM_CONDITIONAL([gl_GNULIB_ENABLED_2049e887c7e5308faad27b3f894bb8c9], [$gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9]) | 660 | AM_CONDITIONAL([gl_GNULIB_ENABLED_2049e887c7e5308faad27b3f894bb8c9], [$gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9]) |
| 633 | AM_CONDITIONAL([gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31], [$gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31]) | 661 | AM_CONDITIONAL([gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31], [$gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31]) |
| 662 | AM_CONDITIONAL([gl_GNULIB_ENABLED_open], [$gl_gnulib_enabled_open]) | ||
| 634 | AM_CONDITIONAL([gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7], [$gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7]) | 663 | AM_CONDITIONAL([gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7], [$gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7]) |
| 635 | AM_CONDITIONAL([gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c], [$gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c]) | 664 | AM_CONDITIONAL([gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c], [$gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c]) |
| 636 | AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll]) | 665 | AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll]) |
| @@ -800,6 +829,8 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 800 | lib/c-strncasecmp.c | 829 | lib/c-strncasecmp.c |
| 801 | lib/careadlinkat.c | 830 | lib/careadlinkat.c |
| 802 | lib/careadlinkat.h | 831 | lib/careadlinkat.h |
| 832 | lib/cloexec.c | ||
| 833 | lib/cloexec.h | ||
| 803 | lib/close-stream.c | 834 | lib/close-stream.c |
| 804 | lib/close-stream.h | 835 | lib/close-stream.h |
| 805 | lib/count-leading-zeros.c | 836 | lib/count-leading-zeros.c |
| @@ -869,6 +900,7 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 869 | lib/mktime-internal.h | 900 | lib/mktime-internal.h |
| 870 | lib/mktime.c | 901 | lib/mktime.c |
| 871 | lib/nstrftime.c | 902 | lib/nstrftime.c |
| 903 | lib/open.c | ||
| 872 | lib/openat-priv.h | 904 | lib/openat-priv.h |
| 873 | lib/openat-proc.c | 905 | lib/openat-proc.c |
| 874 | lib/openat.h | 906 | lib/openat.h |
| @@ -987,10 +1019,13 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 987 | m4/minmax.m4 | 1019 | m4/minmax.m4 |
| 988 | m4/mkostemp.m4 | 1020 | m4/mkostemp.m4 |
| 989 | m4/mktime.m4 | 1021 | m4/mktime.m4 |
| 1022 | m4/mode_t.m4 | ||
| 990 | m4/multiarch.m4 | 1023 | m4/multiarch.m4 |
| 991 | m4/nocrash.m4 | 1024 | m4/nocrash.m4 |
| 992 | m4/nstrftime.m4 | 1025 | m4/nstrftime.m4 |
| 993 | m4/off_t.m4 | 1026 | m4/off_t.m4 |
| 1027 | m4/open-cloexec.m4 | ||
| 1028 | m4/open.m4 | ||
| 994 | m4/pipe2.m4 | 1029 | m4/pipe2.m4 |
| 995 | m4/pselect.m4 | 1030 | m4/pselect.m4 |
| 996 | m4/pthread_sigmask.m4 | 1031 | m4/pthread_sigmask.m4 |
diff --git a/m4/mode_t.m4 b/m4/mode_t.m4 new file mode 100644 index 00000000000..75d372a4a8a --- /dev/null +++ b/m4/mode_t.m4 | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | # mode_t.m4 serial 2 | ||
| 2 | dnl Copyright (C) 2009-2017 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 | # For using mode_t, it's sufficient to use AC_TYPE_MODE_T and | ||
| 8 | # include <sys/types.h>. | ||
| 9 | |||
| 10 | # Define PROMOTED_MODE_T to the type that is the result of "default argument | ||
| 11 | # promotion" (ISO C 6.5.2.2.(6)) of the type mode_t. | ||
| 12 | AC_DEFUN([gl_PROMOTED_TYPE_MODE_T], | ||
| 13 | [ | ||
| 14 | AC_REQUIRE([AC_TYPE_MODE_T]) | ||
| 15 | AC_CACHE_CHECK([for promoted mode_t type], [gl_cv_promoted_mode_t], [ | ||
| 16 | dnl Assume mode_t promotes to 'int' if and only if it is smaller than 'int', | ||
| 17 | dnl and to itself otherwise. This assumption is not guaranteed by the ISO C | ||
| 18 | dnl standard, but we don't know of any real-world counterexamples. | ||
| 19 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]], | ||
| 20 | [[typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];]])], | ||
| 21 | [gl_cv_promoted_mode_t='int'], | ||
| 22 | [gl_cv_promoted_mode_t='mode_t']) | ||
| 23 | ]) | ||
| 24 | AC_DEFINE_UNQUOTED([PROMOTED_MODE_T], [$gl_cv_promoted_mode_t], | ||
| 25 | [Define to the type that is the result of default argument promotions of type mode_t.]) | ||
| 26 | ]) | ||
diff --git a/m4/open-cloexec.m4 b/m4/open-cloexec.m4 new file mode 100644 index 00000000000..897af66910f --- /dev/null +++ b/m4/open-cloexec.m4 | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | # Test whether O_CLOEXEC is defined. | ||
| 2 | |||
| 3 | dnl Copyright 2017 Free Software Foundation, Inc. | ||
| 4 | dnl This file is free software; the Free Software Foundation | ||
| 5 | dnl gives unlimited permission to copy and/or distribute it, | ||
| 6 | dnl with or without modifications, as long as this notice is preserved. | ||
| 7 | |||
| 8 | AC_DEFUN([gl_PREPROC_O_CLOEXEC], | ||
| 9 | [ | ||
| 10 | AC_CACHE_CHECK([for O_CLOEXEC], | ||
| 11 | [gl_cv_macro_O_CLOEXEC], | ||
| 12 | [AC_COMPILE_IFELSE( | ||
| 13 | [AC_LANG_PROGRAM([[#include <fcntl.h> | ||
| 14 | #ifndef O_CLOEXEC | ||
| 15 | choke me; | ||
| 16 | #endif | ||
| 17 | ]], | ||
| 18 | [[return O_CLOEXEC;]])], | ||
| 19 | [gl_cv_macro_O_CLOEXEC=yes], | ||
| 20 | [gl_cv_macro_O_CLOEXEC=no])]) | ||
| 21 | ]) | ||
diff --git a/m4/open.m4 b/m4/open.m4 new file mode 100644 index 00000000000..68253e15ffd --- /dev/null +++ b/m4/open.m4 | |||
| @@ -0,0 +1,95 @@ | |||
| 1 | # open.m4 serial 15 | ||
| 2 | dnl Copyright (C) 2007-2017 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 | AC_DEFUN([gl_FUNC_OPEN], | ||
| 8 | [ | ||
| 9 | AC_REQUIRE([AC_CANONICAL_HOST]) | ||
| 10 | AC_REQUIRE([gl_PREPROC_O_CLOEXEC]) | ||
| 11 | case "$host_os" in | ||
| 12 | mingw* | pw*) | ||
| 13 | REPLACE_OPEN=1 | ||
| 14 | ;; | ||
| 15 | *) | ||
| 16 | dnl open("foo/") should not create a file when the file name has a | ||
| 17 | dnl trailing slash. FreeBSD only has the problem on symlinks. | ||
| 18 | AC_CHECK_FUNCS_ONCE([lstat]) | ||
| 19 | if test "$gl_cv_macro_O_CLOEXEC" != yes; then | ||
| 20 | REPLACE_OPEN=1 | ||
| 21 | fi | ||
| 22 | AC_CACHE_CHECK([whether open recognizes a trailing slash], | ||
| 23 | [gl_cv_func_open_slash], | ||
| 24 | [# Assume that if we have lstat, we can also check symlinks. | ||
| 25 | if test $ac_cv_func_lstat = yes; then | ||
| 26 | touch conftest.tmp | ||
| 27 | ln -s conftest.tmp conftest.lnk | ||
| 28 | fi | ||
| 29 | AC_RUN_IFELSE( | ||
| 30 | [AC_LANG_SOURCE([[ | ||
| 31 | #include <fcntl.h> | ||
| 32 | #if HAVE_UNISTD_H | ||
| 33 | # include <unistd.h> | ||
| 34 | #endif | ||
| 35 | int main () | ||
| 36 | { | ||
| 37 | int result = 0; | ||
| 38 | #if HAVE_LSTAT | ||
| 39 | if (open ("conftest.lnk/", O_RDONLY) != -1) | ||
| 40 | result |= 1; | ||
| 41 | #endif | ||
| 42 | if (open ("conftest.sl/", O_CREAT, 0600) >= 0) | ||
| 43 | result |= 2; | ||
| 44 | return result; | ||
| 45 | }]])], | ||
| 46 | [gl_cv_func_open_slash=yes], | ||
| 47 | [gl_cv_func_open_slash=no], | ||
| 48 | [ | ||
| 49 | changequote(,)dnl | ||
| 50 | case "$host_os" in | ||
| 51 | freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) | ||
| 52 | gl_cv_func_open_slash="guessing no" ;; | ||
| 53 | *) | ||
| 54 | gl_cv_func_open_slash="guessing yes" ;; | ||
| 55 | esac | ||
| 56 | changequote([,])dnl | ||
| 57 | ]) | ||
| 58 | rm -f conftest.sl conftest.tmp conftest.lnk | ||
| 59 | ]) | ||
| 60 | case "$gl_cv_func_open_slash" in | ||
| 61 | *no) | ||
| 62 | AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1], | ||
| 63 | [Define to 1 if open() fails to recognize a trailing slash.]) | ||
| 64 | REPLACE_OPEN=1 | ||
| 65 | ;; | ||
| 66 | esac | ||
| 67 | ;; | ||
| 68 | esac | ||
| 69 | dnl Replace open() for supporting the gnulib-defined fchdir() function, | ||
| 70 | dnl to keep fchdir's bookkeeping up-to-date. | ||
| 71 | m4_ifdef([gl_FUNC_FCHDIR], [ | ||
| 72 | if test $REPLACE_OPEN = 0; then | ||
| 73 | gl_TEST_FCHDIR | ||
| 74 | if test $HAVE_FCHDIR = 0; then | ||
| 75 | REPLACE_OPEN=1 | ||
| 76 | fi | ||
| 77 | fi | ||
| 78 | ]) | ||
| 79 | dnl Replace open() for supporting the gnulib-defined O_NONBLOCK flag. | ||
| 80 | m4_ifdef([gl_NONBLOCKING_IO], [ | ||
| 81 | if test $REPLACE_OPEN = 0; then | ||
| 82 | gl_NONBLOCKING_IO | ||
| 83 | if test $gl_cv_have_open_O_NONBLOCK != yes; then | ||
| 84 | REPLACE_OPEN=1 | ||
| 85 | fi | ||
| 86 | fi | ||
| 87 | ]) | ||
| 88 | ]) | ||
| 89 | |||
| 90 | # Prerequisites of lib/open.c. | ||
| 91 | AC_DEFUN([gl_PREREQ_OPEN], | ||
| 92 | [ | ||
| 93 | AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T]) | ||
| 94 | : | ||
| 95 | ]) | ||
diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4 index 110fe2d1a9f..ec4a058154b 100644 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 | |||
| @@ -21,9 +21,9 @@ AC_DEFUN([gl_STDLIB_H], | |||
| 21 | #endif | 21 | #endif |
| 22 | ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt | 22 | ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt |
| 23 | initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps | 23 | initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps |
| 24 | posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch | 24 | posix_openpt ptsname ptsname_r qsort_r random random_r reallocarray |
| 25 | secure_getenv setenv setstate setstate_r srandom srandom_r | 25 | realpath rpmatch secure_getenv setenv setstate setstate_r srandom |
| 26 | strtod strtoll strtoull unlockpt unsetenv]) | 26 | srandom_r strtod strtoll strtoull unlockpt unsetenv]) |
| 27 | ]) | 27 | ]) |
| 28 | 28 | ||
| 29 | AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], | 29 | AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], |
| @@ -58,6 +58,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], | |||
| 58 | GNULIB_QSORT_R=0; AC_SUBST([GNULIB_QSORT_R]) | 58 | GNULIB_QSORT_R=0; AC_SUBST([GNULIB_QSORT_R]) |
| 59 | GNULIB_RANDOM=0; AC_SUBST([GNULIB_RANDOM]) | 59 | GNULIB_RANDOM=0; AC_SUBST([GNULIB_RANDOM]) |
| 60 | GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R]) | 60 | GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R]) |
| 61 | GNULIB_REALLOCARRAY=0; AC_SUBST([GNULIB_REALLOCARRAY]) | ||
| 61 | GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) | 62 | GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) |
| 62 | GNULIB_REALPATH=0; AC_SUBST([GNULIB_REALPATH]) | 63 | GNULIB_REALPATH=0; AC_SUBST([GNULIB_REALPATH]) |
| 63 | GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH]) | 64 | GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH]) |
| @@ -89,6 +90,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], | |||
| 89 | HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM]) | 90 | HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM]) |
| 90 | HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H]) | 91 | HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H]) |
| 91 | HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) | 92 | HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) |
| 93 | HAVE_REALLOCARRAY=1; AC_SUBST([HAVE_REALLOCARRAY]) | ||
| 92 | HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH]) | 94 | HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH]) |
| 93 | HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH]) | 95 | HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH]) |
| 94 | HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV]) | 96 | HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV]) |