]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: new function: usable_st_size
authorJim Meyering <meyering@redhat.com>
Mon, 7 May 2012 09:20:45 +0000 (11:20 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 8 May 2012 08:34:31 +0000 (10:34 +0200)
src/system.h

index 93d48c57d484ea30d07deaf038e7139f57cb7618..e3d31563c604eb356ac800d7421c34196d1daabf 100644 (file)
@@ -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)  \