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)
committerIan Beckwith <ianb@erislabs.net>
Thu, 8 Sep 2011 02:09:06 +0000 (03:09 +0100)
commitf4293d352452dd3c03c81ea1e14a4d3dcd050de7
treeeb20e14496ccee829009fd35f904fdc9d5fe9f0e
parent7e69b94f4e7cc74ee0cc32249937915576c710d6
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.
(cherry picked from commit a05ce2718959ac0598ae2a30060c10458ed03277)
ChangeLog
lib/openat.c