coredump.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_COREDUMP_H
  3. #define _LINUX_COREDUMP_H
  4. #include <linux/types.h>
  5. #include <linux/mm.h>
  6. #include <linux/fs.h>
  7. #include <asm/siginfo.h>
  8. struct core_vma_metadata {
  9. unsigned long start, end;
  10. unsigned long flags;
  11. unsigned long dump_size;
  12. };
  13. /*
  14. * These are the only things you should do on a core-file: use only these
  15. * functions to write out all the necessary info.
  16. */
  17. struct coredump_params;
  18. extern int dump_skip(struct coredump_params *cprm, size_t nr);
  19. extern int dump_emit(struct coredump_params *cprm, const void *addr, int nr);
  20. extern int dump_align(struct coredump_params *cprm, int align);
  21. extern void dump_truncate(struct coredump_params *cprm);
  22. int dump_user_range(struct coredump_params *cprm, unsigned long start,
  23. unsigned long len);
  24. int dump_vma_snapshot(struct coredump_params *cprm, int *vma_count,
  25. struct core_vma_metadata **vma_meta,
  26. size_t *vma_data_size_ptr);
  27. #ifdef CONFIG_COREDUMP
  28. extern void do_coredump(const kernel_siginfo_t *siginfo);
  29. #else
  30. static inline void do_coredump(const kernel_siginfo_t *siginfo) {}
  31. #endif
  32. extern int core_uses_pid;
  33. extern char core_pattern[];
  34. extern unsigned int core_pipe_limit;
  35. #endif /* _LINUX_COREDUMP_H */