From: Jim Meyering Date: Mon, 7 May 2012 09:20:45 +0000 (+0200) Subject: maint: new function: usable_st_size X-Git-Tag: v8.17~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=452dc6b5ef39d3a9c26208d960085fe992f4c3b7;p=thirdparty%2Fcoreutils.git maint: new function: usable_st_size --- diff --git a/src/system.h b/src/system.h index 93d48c57d4..e3d31563c6 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) \