// kfile.h : // #if !defined(AGD_KFILE_H__A71FB716_AC33_40F3_95C0_3E47923E77B4__INCLUDED_) #define AGD_KFILE_H__A71FB716_AC33_40F3_95C0_3E47923E77B4__INCLUDED_ #ifdef __cplusplus extern "C" { #endif // __cplusplus ///////////////////////////////////////////////////////////////////////////// // // https://stackoverflow.com/questions/1184274/read-write-files-within-a-linux-kernel-module // ///////////////////////////////////////////////////////////////////////////// // kofile.h - Declarations: struct file* kf_open(const char *path, int flags, int rights); struct file* kf_open_locked(const char *path, int flags, int rights); void kf_close(struct file *pf); int kf_read(struct file *pf, unsigned long long offset, unsigned char *data, unsigned int size); int kf_write(struct file *pf, unsigned long long offset, unsigned char *data, unsigned int size); long kf_ioctl(struct file *pf, unsigned int cmd, unsigned long arg); int kf_sync(struct file *pf); ///////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif // __cplusplus #endif // !defined(AGD_KFILE_H__A71FB716_AC33_40F3_95C0_3E47923E77B4__INCLUDED_)