summaryrefslogtreecommitdiff
path: root/src/stat.c
AgeCommit message (Collapse)Author
2008-10-06stat: add lustre filesystem typeAndreas Dilger
* src/stat.c (human_fstype) [S_MAGIC_LUSTRE]: Add case. Make "stat -f" recognize the "Lustre" filesystem type. <http://en.wikipedia.org/wiki/Lustre_(file_system)> * NEWS: Mention this feature.
2008-09-14stat: remove obsolete and undocumented option, --filesystemJim Meyering
* src/stat.c: Remove obsolete and undocumented --filesystem.
2008-06-28doc: add "..." to Usage, to indicate there may be multiple OPTIONsJim Meyering
* src/base64.c (usage): Likewise. * src/cat.c (usage): Likewise. * src/md5sum.c (usage): Likewise. * src/mkdir.c (usage): Likewise. * src/mkfifo.c (usage): Likewise. * src/split.c (usage): Likewise. * src/stat.c (usage): Likewise. Heiko Marr reported the problem with mkdir.
2008-06-27factor out time_t-to-string conversion idiomJim Meyering
* src/system.h: Include "inttostr.h". (timetostr): New function, factored out of... * src/date.c (show_date): Use timetostr. * src/du.c (show_date): Likewise. * src/ls.c (print_long_format): Likewise. * src/pinky.c (time_string): Likewise. * src/stat.c (human_time): Likewise. * src/*.c: Don't include inttostr.h, since system.h does. * src/c99-to-c89.diff: Adjust offsets.
2008-06-22stat: warn that the --context (-Z) option (a no-op) is obsoleteJim Meyering
* src/stat.c (main): It will be removed in a couple years. * NEWS (Change in behavior): Mention this.
2008-06-16remove redundant const directivesJim Meyering
In 1463824d8e7f72c31f1d803d7cfe2b608ccafc5c, I added some missing "const" directives, as well as some new, redundant ones. This removes the redundant ones. Pointed out by Eric Blake. * base64.c, cat.c, chcon.c, chgrp.c, chmod.c, chown.c, comm.c: * cp.c, csplit.c, cut.c, date.c, dd.c, df.c, dircolors.c, du.c: * env.c, expand.c, fmt.c, fold.c, groups.c, head.c, id.c: * install.c, join.c, kill.c, ln.c, ls.c, md5sum.c, mkdir.c: * mkfifo.c, mknod.c, mktemp.c, mv.c, nice.c, nl.c, od.c: * paste.c, pathchk.c, pinky.c, pr.c, ptx.c, readlink.c, rm.c: * rmdir.c, runcon.c, seq.c, shred.c, shuf.c, sort.c, split.c: * stat.c, stty.c, su.c, sum.c, tac.c, tail.c, tee.c, timeout.c: * touch.c, tr.c, truncate.c, tty.c, uname.c, unexpand.c, uniq.c: * wc.c, who.c: Remove redundant const directives. * maint.mk (sc_const_long_option): Don't require redundant "const".
2008-06-14add "const" attribute, where possibleJim Meyering
* maint.mk (sc_const_long_option): New rule. Enforce global change. * src/base64.c (long_options): Use "const" where possible. * src/cat.c (main): Likewise. * src/chcon.c (long_options): Likewise. * src/chgrp.c (long_options): Likewise. * src/chmod.c (long_options): Likewise. * src/chown.c (long_options): Likewise. * src/comm.c (long_options, OUTPUT_DELIMITER_OPTION): Likewise. * src/cp.c (long_opts): Likewise. * src/csplit.c (longopts): Likewise. * src/cut.c (longopts): Likewise. * src/date.c (long_options): Likewise. * src/dd.c (conversions, flags, statuses): Likewise. * src/df.c (long_options): Likewise. * src/dircolors.c (long_options): Likewise. * src/du.c (long_options): Likewise. * src/env.c (longopts): Likewise. * src/expand.c (longopts): Likewise. * src/fmt.c (long_options): Likewise. * src/fold.c (longopts): Likewise. * src/groups.c (longopts): Likewise. * src/head.c (long_options): Likewise. * src/id.c (longopts): Likewise. * src/install.c (long_options): Likewise. * src/join.c (longopts): Likewise. * src/kill.c (long_options): Likewise. * src/ln.c (long_options): Likewise. * src/ls.c (long_time_format, long_options, sort_functions): Likewise. * src/md5sum.c (long_options): Likewise. * src/mkdir.c (longopts): Likewise. * src/mkfifo.c (longopts): Likewise. * src/mknod.c (longopts): Likewise. * src/mktemp.c (longopts): Likewise. * src/mv.c (long_options): Likewise. * src/nice.c (longopts): Likewise. * src/nl.c (longopts): Likewise. * src/od.c (charname, long_options): Likewise. * src/paste.c (longopts): Likewise. * src/pathchk.c (longopts): Likewise. * src/pinky.c (longopts): Likewise. * src/pr.c (long_options): Likewise. * src/ptx.c (long_options): Likewise. * src/readlink.c (longopts): Likewise. * src/rm.c (long_opts): Likewise. * src/rmdir.c (longopts): Likewise. * src/runcon.c (long_options): Likewise. * src/seq.c (long_options): Likewise. * src/shred.c (long_opts): Likewise. * src/shuf.c (long_opts): Likewise. * src/sort.c (monthtab, long_options): Likewise. * src/split.c (longopts): Likewise. * src/stat.c (long_options): Likewise. * src/stty.c (mode_info, control_info, longopts, set_mode) Likewise. (set_control_char, speeds): Likewise. * src/su.c (longopts): Likewise. * src/sum.c (longopts): Likewise. * src/tac.c (longopts): Likewise. * src/tail.c (long_options): Likewise. * src/tee.c (long_options): Likewise. * src/timeout.c (long_options): Likewise. * src/touch.c (longopts): Likewise. * src/tr.c (long_options): Likewise. * src/truncate.c (longopts): Likewise. * src/tty.c (longopts): Likewise. * src/uname.c (uname_long_options, arch_long_options): Likewise. * src/unexpand.c (longopts): Likewise. * src/uniq.c (longopts): Likewise. * src/wc.c (longopts): Likewise. * src/who.c (longopts): Likewise.
2008-06-03use gnulib's progname moduleJim Meyering
* bootstrap.conf (gnulib_modules): Add progname. * src/*.c (program_name): Remove declaration. * (main): Call set_program_name rather than setting program_name. * src/nice.c (main): Cast program_name to "(char *)". * src/prog-fprintf.c: Include "system.h" * src/system.h: Include "progname.h". * maint.mk (sc_program_name): Adjust rule. Suggestion from Eric Blake.
2008-06-02declare program_name consistentlyJim Meyering
* src/base64.c: Likewise. * src/basename.c: Likewise. * src/cat.c: Likewise. * src/chcon.c: Likewise. * src/chgrp.c: Likewise. * src/chmod.c: Likewise. * src/chown.c: Likewise. * src/chroot.c: Likewise. * src/cksum.c: Likewise. * src/comm.c: Likewise. * src/cp.c: Likewise. * src/csplit.c: Likewise. * src/cut.c: Likewise. * src/date.c: Likewise. * src/dd.c: Likewise. * src/df.c: Likewise. * src/dircolors.c: Likewise. * src/dirname.c: Likewise. * src/du.c: Likewise. * src/echo.c: Likewise. * src/env.c: Likewise. * src/expand.c: Likewise. * src/expr.c: Likewise. * src/factor.c: Likewise. * src/fmt.c: Likewise. * src/fold.c: Likewise. * src/groups.c: Likewise. * src/head.c: Likewise. * src/hostid.c: Likewise. * src/hostname.c: Likewise. * src/id.c: Likewise. * src/install.c: Likewise. * src/join.c: Likewise. * src/kill.c: Likewise. * src/link.c: Likewise. * src/ln.c: Likewise. * src/logname.c: Likewise. * src/ls.c: Likewise. * src/md5sum.c: Likewise. * src/mkdir.c: Likewise. * src/mkfifo.c: Likewise. * src/mknod.c: Likewise. * src/mktemp.c: Likewise. * src/mv.c: Likewise. * src/nice.c: Likewise. * src/nl.c: Likewise. * src/nohup.c: Likewise. * src/od.c: Likewise. * src/paste.c: Likewise. * src/pathchk.c: Likewise. * src/pinky.c: Likewise. * src/pr.c: Likewise. * src/printenv.c: Likewise. * src/printf.c: Likewise. * src/ptx.c: Likewise. * src/pwd.c: Likewise. * src/readlink.c: Likewise. * src/rm.c: Likewise. * src/rmdir.c: Likewise. * src/runcon.c: Likewise. * src/seq.c: Likewise. * src/setuidgid.c: Likewise. * src/shuf.c: Likewise. * src/sleep.c: Likewise. * src/sort.c: Likewise. * src/split.c: Likewise. * src/stat.c: Likewise. * src/stty.c: Likewise. * src/su.c: Likewise. * src/sum.c: Likewise. * src/sync.c: Likewise. * src/tac.c: Likewise. * src/tail.c: Likewise. * src/tee.c: Likewise. * src/test.c: Likewise. * src/timeout.c: Likewise. * src/touch.c: Likewise. * src/tr.c: Likewise. * src/true.c: Likewise. * src/tsort.c: Likewise. * src/tty.c: Likewise. * src/uname.c: Likewise. * src/unexpand.c: Likewise. * src/uniq.c: Likewise. * src/unlink.c: Likewise. * src/uptime.c: Likewise. * src/users.c: Likewise. * src/wc.c: Likewise. * src/who.c: Likewise. * src/whoami.c: Likewise. * src/yes.c: Likewise.
2008-05-26convert single-author programs to use proper_nameJim Meyering
g grep -E -l 'define AUTHORS "[^,]+"$'|xargs perl -pi -e \ 's/(define AUTHORS) ("[^,]+")$/$1 proper_name ($2)/'
2008-02-28Make copyright comments consistent.Jim Meyering
* src/mktemp.c: Update copyright to use newer form. Make first copyright lines consistent. Some did not end in ", Inc.". Due to that missing ", Inc" at end of line, emacs' copyright-updating code missed some opportunities. This corrects most of those, and adds some mistakenly omitted years. * src/chown-core.c: Adjust. * src/chown-core.h: Likewise. * src/copy.c: Likewise. * src/copy.h: Likewise. * src/cp-hash.c: Likewise. * src/cp.c: Likewise. * src/group-list.h: Likewise. * src/mktemp.c: Likewise. * src/stat.c: Likewise. * tests/chmod/equal-x: Likewise. * tests/dd/skip-seek: Likewise. * tests/envvar-check: Likewise. * tests/mv/into-self-2: Likewise.
2007-12-01* NEWS: Mention some of the SELinux changes.Jim Meyering
Record release date and new version number. * src/stat.c (main): Adjust a comment.
2007-08-28Reflect renaming: mreadlink-with-size -> areadlink-with-size.Jim Meyering
* bootstrap.conf: Update module name. * src/copy.c (copy_internal): Update header and function names. * src/ls.c (get_link_name): Likewise. * src/readlink.c (main): Likewise. * src/stat.c (print_stat): Likewise.
2007-08-28Add file system type names and magic numbers from "man 2 statfs".Jim Meyering
* src/stat.c (human_fstype): Also handle BEFS, BFS, BINFMT_MISC, FUSECTL, HUGETLBFS, NFSD and OPENPROM.
2007-08-27Add some file system type names and magic numbers from glibc.Jim Meyering
* src/stat.c (human_fstype): Add any file system names and values present in glibc's linux_fsinfo.h but not in this list. Alphabetize the S_* names and capitalize the hexadecimal constants.
2007-07-23Update all copyright notices to use the newer form.Jim Meyering
2007-07-10Change "version 2" to "version 3" in all copyright notices.Jim Meyering
2007-06-22* src/stat.c (long_options): Add a FIXME comment to help ensureJim Meyering
that the deprecated and undocumented "--filesystem" option is removed someday.
2007-06-18Use mreadlink_with_size (doesn't exit), not xreadlink_with_size.Jim Meyering
* bootstrap.conf (gnulib_modules): Add readlink-with-size. Remove xreadlink and xreadlink-with-size. * src/copy.c (copy_internal): Use mreadlink_with_size, not xreadlink_with_size. * src/ls.c (get_link_name): Likewise. * src/readlink.c (main): Likewise. * src/stat.c (print_stat): Likewise.
2007-03-29stat: Add support for SELinux in the form of a %C format directive.Jim Meyering
* src/stat.c (follow_links): Make this variable file-global. (out_file_context): New function. (print_statfs): Honor %C. (print_stat): Honor %C. (do_stat): Remove follow_links parameter. (usage): Document the two %C directives. (main): Accept -Z (though it's a no-op). * src/Makefile.am (stat_LDADD): Define.
2007-03-28Help translators include translation team's web or email address.Jim Meyering
* src/system.h (emit_bug_reporting_address): New function. * src/base64.c: Use it rather than a literal printf. * src/basename.c, src/cat.c, src/chgrp.c, src/chmod.c: * src/chown.c, src/chroot.c, src/cksum.c, src/comm.c, src/cp.c: * src/csplit.c, src/cut.c, src/date.c, src/dd.c, src/df.c: * src/dircolors.c, src/dirname.c, src/du.c, src/echo.c, src/env.c: * src/expand.c, src/expr.c, src/factor.c, src/fmt.c, src/fold.c: * src/head.c, src/hostid.c, src/hostname.c, src/id.c, src/install.c: * src/join.c, src/kill.c, src/link.c, src/ln.c, src/logname.c: * src/ls.c, src/md5sum.c, src/mkdir.c, src/mkfifo.c, src/mknod.c: * src/mv.c, src/nice.c, src/nl.c, src/nohup.c, src/od.c: * src/paste.c, src/pathchk.c, src/pinky.c, src/pr.c, src/printenv.c: * src/printf.c, src/ptx.c, src/pwd.c, src/readlink.c, src/rm.c: * src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c, src/shuf.c: * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c: * src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac.c: * src/tail.c, src/tee.c, src/test.c, src/touch.c, src/tr.c: * src/true.c, src/tsort.c, src/tty.c, src/uname.c, src/unexpand.c: * src/uniq.c, src/unlink.c, src/uptime.c, src/users.c, src/wc.c: * src/who.c, src/whoami.c, src/yes.c: Likewise.
2007-03-01* bootstrap.conf (gnulib_modules): Replace xreadlink withBruno Haible
xreadlink-with-size. Add xreadlink. * src/copy.c (copy_internal): Update. * src/ls.c (is_directory): Update. * src/stat.c (print_stat): Update. * src/readlink.c (main): Use the one-argument xreadlink function.
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.