summaryrefslogtreecommitdiff
path: root/lib/stat.c
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* fflush, stat: no 'static inline'Paul Eggert2012-11-291-1/+1
| | | | | | | | | | | | | | * lib/fflush.c (clear_ungetc_buffer_preserving_position) (clear_ungetc_buffer, disable_seek_optimization) (restore_seek_optimization, update_fpos_cache): * lib/stat.c (orig_stat): Now static, not static inline. * lib/fflush.c (disable_seek_optimization, restore_seek_optimization) (update_fpos_cache): Define only if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1). * m4/fflush.m4 (gl_PREREQ_FFLUSH): * m4/stat.m4 (gl_PREREQ_STAT): Do not require AC_C_INLINE.
* stat, fstat: Avoid warnings on mingw64.Bruno Haible2012-06-201-0/+1
| | | | | | | * lib/stat.c (stat) [_GL_WINDOWS_64_BIT_ST_SIZE]: Undefine before redefining. * lib/fstat.c (stat, fstat) [_GL_WINDOWS_64_BIT_ST_SIZE]: Likewise. Reported by Daniel P. Berrange <berrange@redhat.com>.
* Large File Support for native Windows platforms.Bruno Haible2012-04-211-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * m4/largefile.m4 (gl_LARGEFILE): New macro. * modules/largefile (configure.ac): Require gl_LARGEFILE. * lib/sys_types.in.h (off_t) [WINDOWS_64_BIT_OFF_T]: Define to a 64-bit type. * m4/sys_types_h.m4 (gl_SYS_TYPES_H): Set WINDOWS_64_BIT_OFF_T. * modules/sys_types (Makefile.am): Substitute WINDOWS_64_BIT_OFF_T. * doc/posix-headers/sys_types.texi: Mention the effect of the 'largefile' module. * lib/fcntl.in.h: Add comments about off_t. * modules/fcntl-h (Depends-on): Add sys_types. * lib/unistd.in.h [WINDOWS_64_BIT_OFF_T]: Include <sys/types.h>. (ftruncate): Replace it if REPLACE_FTRUNCATE is 1. * m4/unistd_h.m4 (gl_UNISTD_H): Require gl_SYS_TYPES_H. (gl_UNISTD_H_DEFAULTS): Initialize REPLACE_FTRUNCATE. * modules/unistd (Depends-on): Add sys_types. (Makefile.am): Substitute WINDOWS_64_BIT_OFF_T, REPLACE_FTRUNCATE. * lib/lseek.c (rpl_lseek) [_GL_WINDOWS_64_BIT_OFF_T]: Use _lseeki64 instead of lseek. * m4/lseek.m4 (gl_FUNC_LSEEK): Require gl_SYS_TYPES_H. Set REPLACE_LSEEK if WINDOWS_64_BIT_OFF_T is 1. * modules/lseek (Depends-on): Add sys_types. * lib/ftruncate.c: Put under GPLv3+. Include <windows.h>, msvc-nothrow.h. (SetFileSize): New function. (ftruncate) [_GL_WINDOWS_64_BIT_OFF_T]: New implementation. * m4/ftruncate.m4 (gl_FUNC_FTRUNCATE): Set REPLACE_FTRUNCATE on Windows if Large File Support is requested. * modules/ftruncate (configure.ac): Consider REPLACE_FTRUNCATE. (Depends-on): Add sys_types, msvc-nothrow. Update conditions. * lib/stdio.in.h: Add comments about off_t. * modules/stdio (Depends-on): Add sys_types. * lib/ftello.c [_GL_WINDOWS_64_BIT_OFF_T]: Use _ftelli64 or ftello64 instead of ftello. * m4/ftello.m4 (gl_FUNC_FTELLO): Require gl_SYS_TYPES_H. Set REPLACE_FTELLO if WINDOWS_64_BIT_OFF_T is 1. (gl_PREREQ_FTELLO): New macro. * modules/ftello (Depends-on): Add sys_types. (configure.ac): Incoke gl_PREREQ_FTELLO. * lib/fseeko.c [_GL_WINDOWS_64_BIT_OFF_T]: Use _fseeki64 or fseeko64 instead of fseeko. * m4/fseeko.m4 (gl_FUNC_FSEEKO): Require gl_SYS_TYPES_H. Set REPLACE_FSEEKO if WINDOWS_64_BIT_OFF_T is 1. (gl_PREREQ_FSEEKO): New macro. * modules/fseeko (Depends-on): Add sys_types. (configure.ac): Invoke gl_PREREQ_FSEEKO. * lib/sys_stat.in.h: Add comments about off_t. (stat, fstat) [WINDOWS_64_BIT_ST_SIZE]: Define to variants that use a 64-bit integer for st_size in 'struct stat'. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Set WINDOWS_64_BIT_ST_SIZE. Define _GL_WINDOWS_64_BIT_ST_SIZE. * modules/sys_stat (Depends-on): Add sys_types. (Makefile.am): Substitute WINDOWS_64_BIT_ST_SIZE. * lib/stat.c (stat) [_GL_WINDOWS_64_BIT_ST_SIZE]: Define to _stati64 instead of stat or _stat. * lib/fstat.c [_GL_WINDOWS_64_BIT_ST_SIZE]: Use _fstati64 and 'struct _stati64' instead of fstat and 'struct stat'. * m4/fstat.m4 (gl_FUNC_FSTAT): Require gl_HEADER_SYS_STAT_H. Set REPLACE_FSTAT if WINDOWS_64_BIT_ST_SIZE is 1. Reported by Ray Satiro <raysatiro@yahoo.com>.
* stat: Bypass buggy override in mingw64.Bruno Haible2012-04-141-0/+9
| | | | | | * m4/stat.m4 (gl_FUNC_STAT): Update comments. * lib/stat.c (stat) [mingw64]: Define to _stat. * doc/posix-functions/stat.texi: Mention mingw64 bug.
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* * lib/stat.c: Move comment.Paul Eggert2011-09-191-2/+2
|
* stat: use pathmax.h only if neededPaul Eggert2011-09-181-4/+7
| | | | | | * lib/stat.c: Include pathmax.h only if REPLACE_FUNC_STAT_DIR. This is better for Emacs, which does not have a mingw port and therefore can avoid the pathmax module.
* stat: Support for MSVC.Bruno Haible2011-09-131-0/+1
| | | | | * lib/stat.c: Include pathmax.h. * modules/stat (Depends-on): Add pathmax.
* 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.
* Avoid endless recursions if config.h includes some header files.Bruno Haible2011-08-301-1/+4
| | | | | | | | | * lib/fopen.c (__need_FILE): Define already before including config.h. * lib/freopen.c (__need_FILE): Likewise. * lib/open.c (__need_system_fcntl_h): Likewise. * lib/stat.c (__need_system_sys_stat_h): Likewise. * lib/lstat.c (__need_system_sys_stat_h): Likewise. Reported by Michael Goffioul <michael.goffioul@gmail.com>.
* stat: be robust to PATH_MAX definitionEric Blake2011-06-221-0/+8
| | | | | | | | | Make this stack-allocation of PATH_MAX bytes more robust. * lib/stat.c (rpl_stat): Require reasonable PATH_MAX. * modules/stat (Depends-on): Add verify. Signed-off-by: Eric Blake <eblake@redhat.com>
* dirname: move m4/dos.m4 functionality into lib/dosname.hPaul Eggert2011-02-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | m4/dos.m4 needs to go. It laboriously invokes the C compiler, and extracts symbols from it, puts them into config.h; but it's much easier to use the symbols directly. filename.h already does this, but it disagrees with dos.m4 in some respects. This patch introduces a different include file dosname.h that packages up dos.m4, and then later we can work on merging filename.h and dosname.h. Applications that need only the easy-to-configure symbols should consider including dosname.h rather than dirname.h. * NEWS: Mention incompatible changes. * m4/dos.m4: Remove. * lib/dosname.h, modules/dosname: New files. * lib/dirname.h (ISSLASH, FILE_SYSTEM_PREFIX_LEN): (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE): (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): Move to lib/dosname.h. * lib/at-func.c, lib/at-func2.c, lib/openat.c, lib/savewd.c: Include dosname.h, not dirname.h. * lib/rmdir.c, lib/stat.c, lib/unlink.c, lib/unlinkat.c: Include dosname.h, for definitions of symbols like ISSLASH that used to be in config.h. * m4/dirname.m4 (gl_DIRNAME_LGPL): Do not require gl_AC_DOS. * m4/rmdir.m4 (gl_FUNC_RMDIR): Likewise. * m4/stat.m4 (gl_FUNC_STAT): Likewise. * m4/unlink.m4 (gl_FUNC_UNLINK): Likewise. * modules/dirname-lgpl (Files): Omit m4/dos.m4. * modules/rmdir (Files): Likewise. * modules/stat (Files): Likewise. * modules/unlink (Files): Likewise. * modules/dirname-lgpl (Depends-on): Add dosname. * modules/lstat (Depends-on): Likewise. * modules/openat (Depends-on): Likewise. * modules/rmdir (Depends-on): Likewise. * modules/savewd (Depends-on): Likewise. * modules/stat (Depends-on): Likewise. * modules/unlink (Depends-on): Likewise. * modules/openat (Depends-on): Remove dirname-lgpl. * modules/savewd (Depends-on): Likewise. * tests/test-dirname.c: Do not use removed symbols like FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR. Instead, use the remaining symbols, e.g., ISSLASH ('\\').
* 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-4/+4
|
* stat: fix Solaris 9 bugEric Blake2009-09-191-9/+35
| | | | | | | | | | | stat("file/",buf) mistakenly succeeded. * m4/stat.m4 (gl_FUNC_STAT): Detect Solaris 9 bug with trailing slash. * lib/stat.c (rpl_stat): Work around it. * doc/posix-functions/stat.texi (stat): Update documentation. Signed-off-by: Eric Blake <ebb9@byu.net>
* stat: new module, for mingw bugEric Blake2009-09-191-0/+78
| | | | | | | | | | | | | | | | | | | | | Depending on the current directory, either stat(".",buf) or stat("./",buf) would fail on mingw. * modules/stat: New file. * lib/stat.c: Likewise. * m4/stat.m4 (gl_FUNC_STAT): Likewise. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Add witnesses. * modules/sys_stat (Makefile.am): Use them. * lib/sys_stat.in.h (stat): Declare replacement. * lib/openat.c (fstatat): Deal with lstat and stat being function macros. * modules/openat (Depends-on): Add inline. * MODULES.html.sh (systems lacking POSIX:2008): Mention module. * doc/posix-functions/stat.texi (stat): Likewise. * modules/stat-tests: New test. * tests/test-stat.c: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* Remove stat module & update lstat.Derek R. Price2005-06-241-111/+0
| | | | | | | | | | | | | | | | | | * MODULES.html.sh (stat): Remove. * MODULES.html: Regenerated. * config/srclist.txt (GLIBC sources): Remove stat. * lib/stat.c: Remove this file... (slash_aware_lstat): ...moving this content and its support... * lib/lstat.c (rpl_lstat): ...into here. * lib/lstat.h: New file. * m4/lstat.m4 (gl_FUNC_LSTAT): Drop AC_FUNC_LSTAT in favor of AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK. * m4/stat.m4: Remove this file. * modules/lstat (Description): Correct function name. (Files): Add "lstat.h". (Depends-on): Remove stat, add xalloc, stat-macros. * modules/stat: Remove this file. (Include): Add "lstat.h", remove <sys/stat.h>.
* *** empty log message ***Paul Eggert2005-05-141-1/+1
|
* Merge from coreutils.Paul Eggert2004-08-071-16/+2
|
* Remove K&R cruft.Paul Eggert2003-09-101-11/+1
|
* Correct SunOS and Solaris version number notation to match Sun's usage.Paul Eggert2003-07-221-4/+6
|
* [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.Jim Meyering2003-06-111-4/+9
|
* Don't declare xmalloc explicitly.Jim Meyering2003-06-071-2/+2
| | | | Instead, include "xalloc.h".
* * stat.c: New file. Contents mostly from xstat.in.Jim Meyering2002-12-041-0/+128
| | | | Rework so that it may serve to define rpl_lstat, too.
* .Jim Meyering1998-12-121-49/+0
|
* (rpl_stat): Protoize.Jim Meyering1998-11-081-8/+1
| | | | (stat): Remove #undef.
* Set errno to ENOENT, not EINVAL. This is consistentJim Meyering1998-01-131-3/+9
| | | | with most other implementations.
* .Jim Meyering1997-09-021-0/+50