From 452dc6b5ef39d3a9c26208d960085fe992f4c3b7 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 7 May 2012 11:20:45 +0200 Subject: maint: new function: usable_st_size --- src/system.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/system.h') 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) \ -- cgit v1.2.3-54-g00ecf