kfile.h 1.1 KB

1234567891011121314151617181920212223242526272829
  1. // kfile.h :
  2. //
  3. #if !defined(AGD_KFILE_H__A71FB716_AC33_40F3_95C0_3E47923E77B4__INCLUDED_)
  4. #define AGD_KFILE_H__A71FB716_AC33_40F3_95C0_3E47923E77B4__INCLUDED_
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif // __cplusplus
  8. /////////////////////////////////////////////////////////////////////////////
  9. //
  10. // https://stackoverflow.com/questions/1184274/read-write-files-within-a-linux-kernel-module
  11. //
  12. /////////////////////////////////////////////////////////////////////////////
  13. // kofile.h - Declarations:
  14. struct file* kf_open(const char *path, int flags, int rights);
  15. void kf_close(struct file *pf);
  16. int kf_read(struct file *pf, unsigned long long offset, unsigned char *data, unsigned int size);
  17. int kf_write(struct file *pf, unsigned long long offset, unsigned char *data, unsigned int size);
  18. long kf_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
  19. int kf_sync(struct file *pf);
  20. /////////////////////////////////////////////////////////////////////////////
  21. #ifdef __cplusplus
  22. }
  23. #endif // __cplusplus
  24. #endif // !defined(AGD_KFILE_H__A71FB716_AC33_40F3_95C0_3E47923E77B4__INCLUDED_)