summaryrefslogtreecommitdiff
path: root/src/stat.c
AgeCommit message (Collapse)Author
2006-11-27Improve the check for departures from C89, and fix the departuresPaul Eggert
I found. * Makefile.maint (my-distcheck): Also check for C89 compatibility as best we can with GCC. * src/stat.c (PRINTF_OPTION): Omit comma before } in enum declaration; C89 doesn't allow this. * src/dcgen: Don't generate string literals longer than what C89 requires support for. * src/cut.c (usage): Don't use string literals longer than what C89 requires support for. * src/date.c (usage): Likewise. * src/dd.c (usage): Likewise. * src/du.c (usage): Likewise. * src/ls.c (usage): Likewise. * src/od.c (usage): Likewise. * src/readlink.c (usage): Likewise. * src/seq.c (usage): Likewise. * src/shred.c (usage): Likewise.
2006-09-01Fix typo in previous change; an unsigned int wasn't converted toPaul Eggert
uintmax_t at the right time. Problem reported by Bruno.
2006-09-01* m4/jm-macros.m4 (gl_MACROS): Call cu_PREREQ_STAT_PROG ratherPaul Eggert
than AC_REQUIREing, so that sys/mount.h isn't tested for after the test result. I'm not sure why this fix is needed, but it works. * m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Revamp to reflect better what stat.c actually needs. * src/stat.c: Include <stddef.h> (alignof): New macro. (HAVE_STRUCT_STATXFS_F_FSID___VAL, HAVE_STRUCT_STATXFS_F_FSID_VAL): Remove. (STRUCT_STATXFS_F_FSID_IS_INTEGER): New macro. (FSID_VAL): Remove. (print_statfs): If f_fsid isn't an integer, grab its words one at a time in little-endian order. This is a bit easier to configure and should avoid a compilation failure on MacOS reported by Bruno Haible.
2006-08-29* src/stat.c (HAVE_STRUCT_STATXFS_F_FSID_VAL, FSID_VAL): New macros, toPaul Eggert
work around a Mac OS X porting problem reported by Bruno Haible in <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00308.html>. (print_statfs): Use them. * m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Check for __val versus val components of fsid. Omit some checks that stat.c doesn't care about.
2006-08-24* src/stat.c (print_statfs): Fix typo: remove extra "sizeof".Jim Meyering
2006-08-23* src/stat.c (HAVE_STRUCT_STATXFS_F_FSID___VAL): Define. ThisPaul Eggert
macro was being used without being defined. (SB_F_NAMEMAX): Remove cast. (f_fsid) [BeOS]: Likewise. (OUT_NAMEMAX): Renamed from NAMEMAX_FORMAT, with a new meaning. All uses changed. (out_string, out_int, out_uint, out_uint_o, out_uint_x): New functions. (xstrcat): Remove. All uses changed to use the above functions. (print_statfs, print_stat): 2nd arg is now the prefix len, not the buffer len. All uses changed. Output '?', not '*', for unknown data or errors. Do not assume signed values can be interchanged with unsigned when printing. (print_statfs): For %i, print the fsid as a single int, not as a pair. (print_it): Quote invalid format better. (STRUCT_STATVFS, statfs, f_fsid, f_blocks, f_bfree) [BeOS]: (f_bavail, f_bsize, STATFS_FRSIZE, f_files, f_ffree) [BeOS]: (STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME) [BeOS]: Define.
2006-08-20the patch from 2006-08-18 broke on cygwin.Paul Eggert
2006-08-18Add support for NetBSD 3.0.Paul Eggert
* src/stat.c (USE_STATVFS): Set to 1 if 'struct statvfs' has a field f_fstypename. (STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME): Define also if 'struct statvfs' has a field f_fstypename. This undoes the 2006-08-15 to src/stat.c. * lib/mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h. (ME_DUMMY): Treat "kernfs" as a dummy. (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement. * m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Also check for sys/statvfs.h. When getmntinfo was found, check its declaration and set either MOUNTED_GETMNTINFO or MOUNTED_GETMNTINFO2 depending on it. * m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Test also for f_fstypename in struct statvfs.
2006-08-15(USE_STATVFS): Define to 0 if f_type is needed, butPaul Eggert
statvfs.f_type not present.
2006-07-09(print_it): Don't assume char is unsigned.Paul Eggert
2006-04-17(human_access): Use (new) filemodestring rather thanPaul Eggert
(old) mode_string, so that we get more file types right, at least in theory. Adjust to filemode changes.
2006-04-12(USE_STATVFS): New macro.Paul Eggert
Include <sys/statvfs.h> and use statvfs only if USE_STATVFS. (NAMEMAX_FORMAT): define a bit more clearly, now that the statvfs-using code is a bit more regular.
2005-12-15(print_it): Properly handle a backslash at theJim Meyering
end of a --printf format string. Reported by Paul Eggert.
2005-12-15revert behavior of --format=FMT (-c)Jim Meyering
add new option: --printf=FMT (isodigit, octtobin, hextobin): Define. (PRINTF_OPTION): Define. (interpret_backslash_escapes, trailing_delim): New globals. (usage): Document them. Alphabetize on long option names. (print_esc_char): New function. (print_it): Rewrite, in order to handle backslash escapes. (main): Handle new option. Set globals for --format, too.
2005-10-15(main): Remove --link -l options.Jim Meyering
You can use --dereference (-L) instead.
2005-09-16Include stat-time.h, and use its functions instead of the obsoletePaul Eggert
TIMESPEC_NS macro.
2005-05-14Update FSF postal mail address.Jim Meyering
2005-05-14Update FSF postal mail address.Jim Meyering
2005-04-04(usage): Move USAGE_BUILTIN_WARNING to end of --help output.Jim Meyering
2005-04-04(usage): Mention that some shells provide a built-inJim Meyering
function by the same name.
2005-03-28(long_options): Use NULL, not `0'.Jim Meyering
2005-03-12Add a little infrastructure to help prevent future bugs like theJim Meyering
one fixed today. (xstrcat): New function. (print_statfs, print_stat): Add buf_len parameter and convert all uses of strcat to xstrcat. Update callers. (print_it): Call print_func with buf_len parameter.
2005-03-12Invoking stat -c FMT with a lone format directive of %s, %f, %h, %s,Jim Meyering
could cause a buffer overrun error. (print_it): Allocate 2 more bytes, to accommodate our conversion of the stat %s format string to the longer printf %llu one. Patch from Guochun Shi.
2005-02-15(human_fstype): Add case/definition for S_MAGIC_JFSJim Meyering
so that file systems of type `jfs' are recognized as such.
2005-02-15(human_fstype): Add case/definition for S_MAGIC_XFSJim Meyering
so that file systems of type `xfs' are recognized as such.
2005-02-08(STATFS_FRSIZE): New macro.Paul Eggert
(print_statfs): Use it to implement %S. (do_statfs): Change default formats to include %S. (usage): Document %S (versus %s).
2005-02-08(usage): Normalize terminology, capitalization, and sort order toPaul Eggert
match manual. Say that %s is the "Fundamental block size", since that is what POSIX says.
2004-11-17(STATFS): New macro, for portability to Solaris 9.Paul Eggert
(do_statfs): Use it.
2004-09-03(HAVE_STRUCT_STATXFS_F_TYPE): Fix typo that preventedPaul Eggert
it from ever being nonzero. Reported by Pozsar Balazs in: http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00189.html (human_fstype): Add ramfs, squashfs, sysfs. Reported by Pozsar Balazs in: http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00188.html (human_fstype): Return char const *, not char *. Simplify internals a bit, and avoid casts.
2004-08-04(print_stat): Don't assume st_ino / st_dev fits inPaul Eggert
unsigned long; this isn't true for st_ino on Solaris 9.
2004-08-03(G_fail): Remove.Paul Eggert
(print_statfs): Print various gotta-be-nonnegative values using unsigned long int, not long int or int. (do_statfs, do_stat): Return a boolean success flag. (do_stat, main): Use bool for booleans.
2004-06-30(usage, main): Output "file system" rather than "filesystem".Jim Meyering
(long_options, usage): Rename "--filesystem" to "--file-system". But keep the old name around, for compatibility reasons.
2004-06-21(main): Standardize on the diagnostics given when someone givesJim Meyering
too few operands ("missing operand after `xxx'") or too many operands ("extra operand `xxx'"). Include "quote.h" and/or "error.h" if it wasn't already being included.
2004-06-01(print_stat): Update use of xreadlink.Jim Meyering
2004-04-09undo last changeJim Meyering
2004-04-09Don't include "file-type.h", now that system.h does.Jim Meyering
2004-04-04A specified format is no longer automatically newline terminated.Jim Meyering
If you want a newline at the end of your format, use `\n'. (print_it): Don't print a newline at the end of every format. (do_statfs): Add a newline at end of each default format string.
2004-02-05(human_time): Correct merge problem.Jim Meyering
2004-02-05Include "inttostr.h".Jim Meyering
(human_time): Print the date/time as a number of seconds since the epoch if it can't be converted by localtime. This is better than just saying "invalid", and is consistent with what "ls" does. Don't dump core if the year has more than 48 digits; this isn't possible on any contemporary host, but we might as well do it right.
2004-02-05(human_time): Accept time rather than pointer-to-const-time parameter,Jim Meyering
for clarity. All callers changed.
2004-02-02(do_stat): Remove extra trailing newline from default formats.Jim Meyering
2004-02-02Print actual fractional seconds in time stamps, not just `.00000000'.Jim Meyering
(human_time): Add and use new parameter, t_ns. (print_stat): Update callers.
2004-01-21(usage): Use EXIT_SUCCESS, not 0, for clarity.Jim Meyering
2004-01-08(human_fstype): Use %lx, not %x format for `unsigned long'.Jim Meyering
2003-10-18Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS changeJim Meyering
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings. Update the call to parse_long_options so that `AUTHORS, NULL' are the last parameters. * src/true.c (main): Append NULL to version_etc argument list. * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
2003-09-18(WRITTEN_BY): Rename from AUTHORS.Jim Meyering
Begin each WRITTEN_BY string with `Written by ' and end it with `.'. Mark each WRITTEN_BY string as translatable.
2003-08-27(print_it): Avoid buffer overrun that would occurJim Meyering
when the user-specified format string ends with `%'.
2003-08-25(main): Warn about use of deprecated `-l' option.Jim Meyering
2003-08-22(do_stat): For link count at end of line, use %h format,Jim Meyering
instead of %-5h. The latter would make stat emit trailing spaces.
2003-07-23Don't include headers already included by system.h:Jim Meyering
Don't include closeout.h.