2
0

pg_rusage.h 851 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_rusage.h
  4. * header file for resource usage measurement support routines
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  8. * Portions Copyright (c) 1994, Regents of the University of California
  9. *
  10. * src/include/utils/pg_rusage.h
  11. *
  12. *-------------------------------------------------------------------------
  13. */
  14. #ifndef PG_RUSAGE_H
  15. #define PG_RUSAGE_H
  16. #include <sys/time.h>
  17. #ifdef HAVE_SYS_RESOURCE_H
  18. #include <sys/resource.h>
  19. #else
  20. #include "rusagestub.h"
  21. #endif
  22. /* State structure for pg_rusage_init/pg_rusage_show */
  23. typedef struct PGRUsage
  24. {
  25. struct timeval tv;
  26. struct rusage ru;
  27. } PGRUsage;
  28. extern void pg_rusage_init(PGRUsage *ru0);
  29. extern const char *pg_rusage_show(const PGRUsage *ru0);
  30. #endif /* PG_RUSAGE_H */