mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-06 01:57:06 +02:00
36b3d52459
<sys/resource.h> is in SUSv2 and is on all targeted Unix systems. We have a replacement for getrusage() on Windows, so let's just move its declarations into src/include/port/win32/sys/resource.h so that we can use a standard-looking #include. Also remove an obsolete reference to CLK_TCK. Also rename src/port/getrusage.c to win32getrusage.c, following the convention for Windows-only fallback code. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
33 lines
786 B
C
33 lines
786 B
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* pg_rusage.h
|
|
* header file for resource usage measurement support routines
|
|
*
|
|
*
|
|
* Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* src/include/utils/pg_rusage.h
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef PG_RUSAGE_H
|
|
#define PG_RUSAGE_H
|
|
|
|
#include <sys/resource.h>
|
|
#include <sys/time.h>
|
|
|
|
|
|
/* State structure for pg_rusage_init/pg_rusage_show */
|
|
typedef struct PGRUsage
|
|
{
|
|
struct timeval tv;
|
|
struct rusage ru;
|
|
} PGRUsage;
|
|
|
|
|
|
extern void pg_rusage_init(PGRUsage *ru0);
|
|
extern const char *pg_rusage_show(const PGRUsage *ru0);
|
|
|
|
#endif /* PG_RUSAGE_H */
|