summaryrefslogtreecommitdiff
path: root/lib/fstatat.c
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* license: fix GPLv3 texts to use a comma instead of semicolon.Bernhard Voelker2022-01-051-1/+1
| | | | | | | | | See: https://www.gnu.org/licenses/gpl-3.0.html#howto Run: $ git grep -l 'Foundation; either version 3' \ | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/' * All files using GPLv3: Adjust via the above command.
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* Include <stdlib.h> when needed.Bruno Haible2019-06-301-0/+1
| | | | | | | | | | | | | | * lib/areadlinkat.c: Include <stdlib.h>, needed for free() in at-func.c. * lib/faccessat.c: Likewise. * lib/fchmodat.c: Likewise. * lib/fchownat.c: Likewise. * lib/fstatat.c: Likewise. * lib/mkfifoat.c: Likewise. * lib/mknodat.c: Likewise. * lib/readlinkat.c: Likewise. * lib/symlinkat.c: Likewise. * lib/utimensat.c: Likewise. * lib/mkdirat.c: Likewise. Include also the specification header.
* stat, lstat: Fix conflict with relocatable-prog-wrapper module.Bruno Haible2019-02-241-1/+5
| | | | | | | | * lib/stat.c: On platforms other than OSF/1, include <sys/stat.h>, not "sys/stat.h". * lib/lstat.c: Likewise. * lib/fstat.c: Likewise. * lib/fstatat.c: Likewise.
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* stat: work around Solaris bug with tv_nsec < 0Paul Eggert2017-11-231-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | * doc/posix-functions/fstat.texi (fstat): * doc/posix-functions/fstatat.texi (fstatat): * doc/posix-functions/lstat.texi (lstat): * doc/posix-functions/stat.texi (stat): Mention Solaris 11 bug. * lib/fstat.c, lib/fstatat.c, lib/lstat.c: Include stat-time.h. * lib/fstat.c (rpl_fstat) [!WINDOWS_NATIVE]: * lib/lstat.c (rpl_lstat): * lib/stat.c (rpl_stat): Normalize resulting timestamps. * lib/fstatat.c (normal_fstatat): New function. (rpl_fstatat): Use it. * lib/stat-time.h: Include intprops.h, errno.h, stddef.h. (stat_time_normalize): New function. * m4/fstat.m4 (gl_FUNC_FSTAT): * m4/fstatat.m4 (gl_FUNC_FSTATAT): * m4/lstat.m4 (gl_FUNC_LSTAT): * m4/stat.m4 (gl_FUNC_STAT): Replace on Solaris. * modules/fstat (Depends-on): * modules/fstatat (Depends-on): Add stat-time. * modules/stat-time (Depends-on): Add errno, intprops.
* fstatat: pacify GCC on unusual platformPaul Eggert2017-11-051-1/+1
| | | | | * lib/fstatat.c (orig_fstatat) [!HAVE_WORKING_FSTATAT_ZERO_FLAG]: Omit, as it’s unused in this case.
* all: Replace many more http URLs by https URLs. Update stale URLs.Bruno Haible2017-09-141-1/+1
| | | | | * users.txt: Remove mention of 'newts'. * lib/localename.c: Update comment about LANG_SOTHO.
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* fchmodat, fchownat, fstatat: port to non-inlining compilersPaul Eggert2012-10-151-2/+0
| | | | | | | | | | | | | | Problem reported for FreeBSD 9 by Jim Meyering in <http://lists.gnu.org/archive/html/bug-gnulib/2012-10/msg00070.html>. * lib/chmodat.c, lib/chownat.c, lib/statat.c: New files, which define FCHMODAT_INLINE etc. * lib/fchmodat.c (FCHMODAT_INLINE): * lib/fchownat.c (FCHOWNAT_INLINE): * lib/fstatat.c (FSTATAT_INLINE): Remove, as chmodat.c etc. now do this. * modules/fchmodat (Files): Add lib/chmodat.c. * modules/fchownat (Files): Add lib/chownat.c. * modules/fstatat (Files): Add lib/statat.c.
* fstatat.c: fix a compile-impeding typoJim Meyering2012-09-291-1/+1
| | | | | * lib/fstatat.c (FSTATAT_INLINE): Fix typo: s/#include/#define/ Introduced in commit v0.0-7636-gd202279.
* fchmodat, fchownat, fstatat: use extern-inlinePaul Eggert2012-09-221-2/+4
| | | | | | | | | | | | | | | * lib/fchmodat.c, lib/openat.h (FCHMODAT_INLINE): * lib/fchownat.c, lib/openat.h (FCHOWNAT_INLINE): * lib/fstatat.c, lib/openat.h (FSTATAT_INLINE): New macros. * lib/openat.h: Replace all uses of 'static inline' with them. Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END. * modules/fchmodat, modules/fchownat, modules/fstatat: * modules/openat-h: (Depends-on): Add extern-inline. (configure.ac): Remove AC_C_INLINE.
* In commentary, do not use ` to quote.Paul Eggert2012-01-051-2/+2
|
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* fstatat: Simplify.Bruno Haible2011-11-191-5/+1
| | | | | | * 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>.
* fstatat: fix configuration bug on mingw, OpenBSD 4, Solaris 8Paul Eggert2011-11-181-1/+1
| | | | | | | | | | | * 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.
* fstatat: work with cross-compilationPaul Eggert2011-11-091-3/+3
| | | | | | | | | | 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.
* openat: Work around compilation error with OSF/1 5.1 DTK cc.Bruno Haible2011-09-081-1/+4
| | | | | | | | | | * 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.
* openat: test for fstatat (..., 0) bugPaul Eggert2011-09-031-14/+9
| | | | | | | | | | | | | | | | | | | 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.
* openat: test for fstatat (AT_FDCWD, ..., 0) bugPaul Eggert2011-09-031-3/+17
| | | | | | | | | | | 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.
* * lib/fstatat.c: Include <sys/types.h> before <sys/stat.h>.Paul Eggert2011-09-011-0/+1
|
* openat: work around AIX 7.1 fstatat issuePaul Eggert2011-09-011-9/+20
| | | | | | | | | | | | 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.
* openat: work around AIX 7.1 fstatat bugPaul Eggert2011-08-301-3/+8
| | | | | | | | | | | | | | 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.
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* Use spaces for indentation, not tabs.Bruno Haible2009-12-101-5/+5
|
* openat: move fstatat and unlinkat into correct filesEric Blake2009-09-191-1/+47
| | | | | | | | | | | | 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>
* openat: fix fstatat bugs on Solaris 9Eric Blake2009-09-191-14/+20
| | | | | | | | | | 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>
* fstatat: fix compilation on SolarisEric Blake2009-09-071-0/+1
| | | | | | | * lib/fstatat.c (includes): Add fcntl.h. Reported by Pádraig Brady. Signed-off-by: Eric Blake <ebb9@byu.net>
* openat: declare in POSIX headersEric Blake2009-09-031-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Change copyright notice from GPLv2+ to GPLv3+.Bruno Haible2007-10-071-5/+4
|
* * lib/openat.h (rpl_fstatat): New macro, ifPaul Eggert2006-11-201-0/+57
[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.