+2014-05-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ fchdir: port 'open' and 'close' redefinitions to AIX 7.1
+ * lib/chown.c, lib/clean-temp.c, lib/copy-file.c, lib/execute.c:
+ * lib/fsusage.c, lib/gc-gnulib.c, lib/javacomp.c, lib/mountlist.c:
+ * lib/openat-proc.c, lib/pagealign_alloc.c, lib/progreloc.c:
+ * lib/spawn-pipe.c:
+ Do not #undef 'open' and 'close'. AIX 7 does '#define open open64'
+ and then 'int open64(const char *, int, ...);', which means the
+ declaration for 'open' gets lost if we later '#undef open'.
+ Discovered while building grep pretest 2.18.151-1c770 on AIX 7.1,
+ where the compilation reported the non-fatal error "In function
+ 'openat_proc_name' ... warning: implicit declaration of function
+ 'open'". In this case the error is relatively harmless, but in
+ other cases it might not be so minor.
+
2014-05-20 Paul Eggert <eggert@cs.ucla.edu>
xalloc: don't potentially generate invalid code for xmemdup calls
/* Below we refer to the system's chown(). */
# undef chown
-/* The results of open() in this file are not used with fchdir,
- therefore save some unnecessary work in fchdir.c. */
-# undef open
-# undef close
-
/* Provide a more-closely POSIX-conforming version of chown on
systems with one or both of the following problems:
- chown doesn't treat an ID of -1 as meaning
# define uintptr_t unsigned long
#endif
-#if !GNULIB_FCNTL_SAFER
-/* The results of open() in this file are not used with fchdir,
- therefore save some unnecessary work in fchdir.c. */
-# undef open
-# undef close
-#endif
-
/* The use of 'volatile' in the types below (and ISO C 99 section 5.1.2.3.(5))
ensure that while constructing or modifying the data structures, the field
#define _(str) gettext (str)
-/* The results of open() in this file are not used with fchdir,
- therefore save some unnecessary work in fchdir.c. */
-#undef open
-#undef close
-
enum { IO_SIZE = 32 * 1024 };
int
#endif
-/* The results of open() in this file are not used with fchdir,
- therefore save some unnecessary work in fchdir.c. */
-#undef open
-#undef close
-
#if defined EINTR && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
# include "full-read.h"
#endif
-/* The results of open() in this file are not used with fchdir,
- therefore save some unnecessary work in fchdir.c. */
-#undef open
-#undef close
-
/* Many space usage primitives use all 1 bits to denote a value that is
not applicable or unknown. Propagate this information by returning
a uintmax_t value that is all 1 bits if X is all 1 bits, even if X
# include "rijndael-api-fst.h"
#endif
-/* The results of open() in this file are not used with fchdir,
- therefore save some unnecessary work in fchdir.c. */
-#undef open
-#undef close
-
#ifdef GNULIB_GC_RANDOM
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
# include <windows.h>
#define _(str) gettext (str)
-/* The results of open() in this file are not used with fchdir,
- therefore save some unnecessary work in fchdir.c. */
-#undef open
-#undef close
-
/* Survey of Java compilers.
# include "unlocked-io.h"
#endif
-/* The results of open() in this file are not used with fchdir,
- therefore save some unnecessary work in fchdir.c. */
-#undef open
-#undef close
-
/* The results of opendir() in this file are not used with dirfd and fchdir,
therefore save some unnecessary work in fchdir.c. */
#undef opendir
#include "intprops.h"
-/* The results of open() in this file are not used with fchdir,
- and we do not leak fds to any single-threaded code that could use stdio,
- therefore save some unnecessary work in fchdir.c.
- FIXME - if the kernel ever adds support for multi-thread safety for
- avoiding standard fds, then we should use open_safer. */
-#undef open
-#undef close
-
#define PROC_SELF_FD_FORMAT "/proc/self/fd/%d/%s"
#define PROC_SELF_FD_NAME_SIZE_BOUND(len) \
# endif
#endif
-/* The results of open() in this file are not used with fchdir,
- therefore save some unnecessary work in fchdir.c. */
-#undef open
-#undef close
-
#if HAVE_MMAP || ! HAVE_POSIX_MEMALIGN
# define FILE_SYSTEM_PREFIX_LEN(P) 0
#endif
-/* The results of open() in this file are not used with fchdir,
- therefore save some unnecessary work in fchdir.c. */
-#undef open
-#undef close
-
/* Use the system functions, not the gnulib overrides in this file. */
#undef sprintf
#endif
-/* The results of open() in this file are not used with fchdir,
- therefore save some unnecessary work in fchdir.c. */
-#undef open
-#undef close
-
#ifdef EINTR