summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-05-07 11:20:45 +0200
committerJim Meyering <meyering@redhat.com>2012-05-08 10:34:31 +0200
commit452dc6b5ef39d3a9c26208d960085fe992f4c3b7 (patch)
tree1f4d6280a6bc4ec700e873851c084035f6474e1b
parentaa078afcf9828344697ef0469272657ac12a30b1 (diff)
downloadcoreutils-452dc6b5ef39d3a9c26208d960085fe992f4c3b7.tar.xz
maint: new function: usable_st_size
-rw-r--r--src/system.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/system.h b/src/system.h
index 93d48c57d..e3d31563c 100644
--- a/src/system.h
+++ b/src/system.h
@@ -601,6 +601,13 @@ bad_cast (char const *s)
return (char *) s;
}
+/* Return a boolean indicating whether SB->st_size is defined. */
+static inline bool
+usable_st_size (struct stat const *sb)
+{
+ return S_ISREG (sb->st_mode) || S_TYPEISSHM (sb) || S_TYPEISTMO (sb);
+}
+
void usage (int status) ATTRIBUTE_NORETURN;
#define emit_cycle_warning(file_name) \