openat: port to AIX 7.1 with large files
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 6 Sep 2011 00:40:58 +0000 (17:40 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 6 Sep 2011 00:41:33 +0000 (17:41 -0700)
commita05ce2718959ac0598ae2a30060c10458ed03277
tree2182231cbf410af9494449ef4a813e271317e87f
parent794c770c24fa69bee4b9826ff8ccceac59fa79bb
openat: port to AIX 7.1 with large files

AIX 7.1 does a "#define openat open64at" if large files are in use,
so we can't simply #undef openat.  Use the orig_openat trick (similar
to orig_open in lib/open.c) to work around the problem.  Problem
reported by Kevin Brott for GNU tar, in the thread containing
<http://lists.gnu.org/archive/html/bug-tar/2011-09/msg00032.html>.
* lib/openat.c (__need_system_fcntl_h): Define first.
Include <fcntl.h> and <sys/types.h> before undefining.
(orig_openat) [HAVE_OPENAT]: New inline function.
(openat) [HAVE_OPENAT]: Do not undef.
(rpl_openat): Use orig_openat, not openat.
ChangeLog
lib/openat.c