/* SPDX-License-Identifier: GPL-2.0+ */ #ifndef _AVM_HELPERS_H_ #include #include /* Return: * < 0: Error (-EIO, -EPERM, -EINVAL) * = 0: Empty file * > 0: Number of bytes read */ int avm_read_from_file(const char *filename, char *str, int maxlen); /* Return: * < 0: Error (-EIO, -EPERM, -EINVAL) * = 0: Success */ int avm_write_to_file(const char *filename, const char *str, int len); #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0) typedef __s64 time64_t; static inline time64_t ktime_get_real_seconds(void) { return get_seconds(); } #endif ssize_t time_to_ascii(time64_t local_time, char *buf, int len); #define _AVM_HELPERS_H_ #endif /* _AVM_HELPERS_H */