lib/fstatat.c


Log

Author Commit Date CI Message
Paul Eggert 51e801f2 2012-01-05T23:53:49 In commentary, do not use ` to quote.
Jim Meyering 1602f0af 2012-01-01T10:04:58 maint: update all copyright year number ranges Run "make update-copyright".
Bruno Haible 53ca4e09 2011-11-19T19:08:02 fstatat: Simplify. * lib/fstatat.c (AT_FUNC_NAME): Define as fstatat. On platforms where gnulib should define rpl_fstatat, there is a "#define fstatat rpl_fstatat" in <sys/stat.h>.
Paul Eggert e0e81281 2011-11-18T18:01:44 fstatat: fix configuration bug on mingw, OpenBSD 4, Solaris 8 * lib/fstatat.c (AT_FUNC_NAME): Use HAVE_FSTAT, not HAVE_WORKING_FSTATAT_ZERO_FLAG, to decide whether to define rpl_fstatat or fstatat. This should fix the other problem reported by Kai Habel in <http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00237.html>. A similar problem was reported for OpenBSD 4.6 by Mats Erik Andersson <http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00239.html> and I reproduced it on a Solaris 8 host we still have in production.
Paul Eggert c098d6b8 2011-11-09T16:11:40 fstatat: work with cross-compilation Problem reported by Ludovic Courtès in <http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00136.html>. * m4/fstatat.m4 (gl_FUNC_FSTATAT): When cross-compiling, report "cross-compiling" and assume the bug is present. Replace FSTATAT_ZERO_FLAG_BROKEN with HAVE_WORKING_FSTATAT_ZERO_FLAG with an inverted sense, to be more conservative about our assumptions. * lib/fstatat.c (rpl_fstatat): Adjust to renamed macro.
Bruno Haible 6563cd76 2011-09-08T00:03:50 openat: Work around compilation error with OSF/1 5.1 DTK cc. * lib/fopen.c: Use different syntax for include of <stdio.h>. * lib/freopen.c: Likewise. * lib/fstatat.c: Use different syntax for include of <sys/stat.h>. * lib/lstat.c: Likewise. * lib/stat.c: Likewise. * lib/open.c: Use different syntax for include of <fcntl.h>. * lib/openat.c: Include fcntl.h again, explicitly.
Paul Eggert 204072b3 2011-09-03T20:17:33 openat: test for fstatat (..., 0) bug Further testing with tar suggests that fstatat (..., 0) does not work in general, on AIX 7.1; see <http://lists.gnu.org/archive/html/bug-tar/2011-09/msg00023.html>. So, give up entirely on AIX 7.1's fstatat, and fall back on our replacement fstatat (which is what older AIX releases were using anyway). * lib/fstatat.c (fstatat) [HAVE_FSTATAT]: Do not undef. The only use is now changed to orig_fstatat. This was probably the right thing to do anyway. (FSTATAT_AT_FDCWD_0_BROKEN): Remove; no longer used. (rpl_fstatat) [FSTATAT_ZERO_FLAG_BROKEN]: Remove. (rpl_fstatat): Simplify, assuming !FSTATAT_ZERO_FLAG_BROKEN. (AT_FUNC_NAME) [FSTATAT_ZERO_FLAG_BROKEN]: Now rpl_fstatat. * m4/openat.m4 (gl_FUNC_FSTATAT): Test for the more-general bug and define FSTATAT_ZERO_FLAG_BROKEN, not FSTATAT_AT_FDCWD_0_BROKEN, if the bug is found.
Paul Eggert e91216b2 2011-09-03T10:03:22 openat: test for fstatat (AT_FDCWD, ..., 0) bug This tests for another fstatat bug on AIX 7.1: fstatat (AT_FDCWD, ..., 0) does not work. See <http://lists.gnu.org/archive/html/bug-tar/2011-09/msg00015.html>. * lib/fstatat.c (FSTATAT_AT_FDCWD_0_BROKEN) (LSTAT_FOLLOWS_SLASHED_SYMLINK): Default to 0. (rpl_fstatat): Adjust so that it works around either (or both) bugs if present. * m4/openat.m4 (gl_FUNC_FSTATAT): Test for this fstatat bug.
Paul Eggert 6cf1a953 2011-09-01T13:10:42 * lib/fstatat.c: Include <sys/types.h> before <sys/stat.h>.
Paul Eggert de1fa2ac 2011-09-01T12:53:10 openat: work around AIX 7.1 fstatat issue This should fix the problem that was not properly fixed in the previous change, dated 2011-08-30. * lib/fstatat.c: Include <sys/stat.h> twice, the first with __need_system_stat_h defined. (orig_fstatat) [HAVE_FSTATAT]: New function. (rpl_fstatat): Go back to the old way of doing things, except call orig_fstatat instead of fstatat. * m4/openat.m4 (gl_FUNC_FSTATAT): Remove unnecessary check for openat. Remove unnecessary check whether fstatat fills in st_size etc.
Paul Eggert 0ba19fcc 2011-08-30T16:38:59 openat: work around AIX 7.1 fstatat bug Problem reported by Kevin Brott for GNU tar, in the thread containing <http://lists.gnu.org/archive/html/bug-tar/2011-08/msg00015.html>. * lib/fstatat.c (rpl_fstatat): Do not invoke underlying fstatat if FSTATAT_ST_SIZE_ETC_BROKEN. (fstatat) [FSTATAT_ST_SIZE_ETC_BROKEN && HAVE_FSTATAT]: #define to rpl_fstatat. * m4/openat.m4 (gl_FUNC_FSTATAT): New macro, with the fstatat-relevant part of gl_FUNC_OPENAT. Also, check for the AIX 7.1 bug, and use AC_CHECK_FUNCS_ONCE for fstatat. (gl_FUNC_OPENAT): Use it. Use AC_CHECK_FUNCS_ONCE for fchmodat, mkdirat, openat and unlinkat.
Jim Meyering d60f3b0c 2011-01-01T20:17:23 maint: update almost all copyright ranges to include 2011 Run the new "make update-copyright" rule.
Jim Meyering b2e2010c 2010-01-01T10:31:12 update nearly all FSF copyright year lists to include 2010 Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
Bruno Haible 441aa304 2009-12-10T20:28:30 Use spaces for indentation, not tabs.
Eric Blake 82bf7d1b 2009-09-19T05:50:30 openat: move fstatat and unlinkat into correct files Code motion, should be no semantic changes. * m4/openat.m4 (gl_FUNC_OPENAT): Adjust which files will be compiled. * lib/openat.c (fstatat, unlinkat): Move... * lib/fstatat.c (fstatat): ...into correct files. * lib/unlinkat.c (unlinkat): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake ff971b94 2009-09-18T19:38:46 openat: fix fstatat bugs on Solaris 9 fstatat(fd,"file/",buf,flag) mistakenly succeeded. * lib/fstatat.c (rpl_fstatat): Copy recent fixes from lstat and stat. * doc/posix-functions/fstatat.texi (fstatat): Document this. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 2c90f1af 2009-09-07T20:16:00 fstatat: fix compilation on Solaris * lib/fstatat.c (includes): Add fcntl.h. Reported by Pádraig Brady. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 52c658e9 2009-09-02T17:14:26 openat: declare in POSIX headers * NEWS: Mention this. * modules/openat (configure.ac): Declare witnesses. (Depends-on): Add fcntl-h, sys_stat, unistd. (Include): Mention correct headers. * modules/fcntl-h (Depends-on): Add link-warning. (Files): Add openat.m4. (Makefile.am): Substitute witnesses. * modules/sys_stat (Files, Makefile.am): Likewise. * modules/unistd (Files, Makefile.am): Likewise. * m4/openat.m4 (gl_FUNC_OPENAT, gl_FUNC_FCHOWNAT): Set witnesses. (gl_OPENAT_DEFAULTS): New macro. * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Use it. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Likewise. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Likewise. (SYS_STAT_H): Remove unused variable. * doc/posix-headers/fcntl.texi (fcntl.h): Update content. * lib/fcntl--.h (includes): Remove unneeded header. * lib/openat-safer.c (includes): Likewise. * lib/openat.h (AT_FDCWD, AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR) (openat, fstatat, unlinkat, mkdirat, fchmodat, fchownat): Move to appropriate headers. (__OPENAT_PREFIX): Delete. * lib/fcntl.in.h (openat): Provide declaration. (AT_FDCWD): Fix Solaris bug. (AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR): Provide macros. * lib/sys_stat.in.h (fstatat, mkdirat): Provide declaration. * lib/fchmodat.c (includes): Adjust to find declaration. * lib/fchownat.c (includes): Likewise. * lib/mkdirat.c (includes): Likewise. * lib/fstatat.c (includes): Likewise. Ensure original fstatat is still visible. Signed-off-by: Eric Blake <ebb9@byu.net>
Bruno Haible 57fdfd3f 2007-10-07T19:14:58 Change copyright notice from GPLv2+ to GPLv3+.
Paul Eggert 229b2a01 2006-11-20T22:01:30 * lib/openat.h (rpl_fstatat): New macro, if [HAVE_OPENAT && ! LSTAT_FOLLOWS_SLASHED_SYMLINK. (fstatat): Define to rpl_fstatat under the same conditions, unless COMPILING_FSTATAT. * m4/openat.m4 (gl_FUNC_OPENAT): Compile fstatat.c too, if fstatat seems to have the bug. * lib/fstatat.c: New file. * modules/openat (Files): Add it.