diff options
Diffstat (limited to 'lib/misc/lvm-file.h')
-rw-r--r-- | lib/misc/lvm-file.h | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/misc/lvm-file.h b/lib/misc/lvm-file.h index c23d8ad..4c405e6 100644 --- a/lib/misc/lvm-file.h +++ b/lib/misc/lvm-file.h @@ -10,12 +10,18 @@ * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _LVM_FILE_H #define _LVM_FILE_H +struct custom_fds { + int out; + int err; + int report; +}; + /* * Create a temporary filename, and opens a descriptor to the file. */ @@ -35,11 +41,6 @@ int lvm_rename(const char *old, const char *new); int path_exists(const char *path); int dir_exists(const char *path); -/* - * Return 1 if dir is empty - */ -int is_empty_dir(const char *dir); - /* Sync directory changes */ void sync_dir(const char *file); @@ -62,4 +63,15 @@ void fcntl_unlock_file(int lockfd); */ int lvm_fclose(FILE *fp, const char *filename); +/* + * Convert stat->st_ctim status of last change in nanoseconds + * uses st_ctime when not available. + */ +void lvm_stat_ctim(struct timespec *ts, const struct stat *buf); + +/* Inspired by <sys/time.h> timercmp() macro for timeval */ +#define timespeccmp(tsp, usp, cmp)\ + (((tsp)->tv_sec == (usp)->tv_sec) ?\ + ((tsp)->tv_nsec cmp (usp)->tv_nsec) :\ + ((tsp)->tv_sec cmp (usp)->tv_sec)) #endif |