diff options
author | Magnus Hagander <magnus@hagander.net> | 2008-05-14 07:28:13 +0000 |
---|---|---|
committer | Magnus Hagander <magnus@hagander.net> | 2008-05-14 07:28:13 +0000 |
commit | 14e6858ff41eea906b8a078c858025bb9e8fa9df (patch) | |
tree | 37c5debeb34b656efb7d625980e0456cf4ddc829 | |
parent | 36f0b1cab774ecf701b7fc10161d565c69942331 (diff) | |
download | postgresql-14e6858ff41eea906b8a078c858025bb9e8fa9df.tar.gz postgresql-14e6858ff41eea906b8a078c858025bb9e8fa9df.zip |
Make the win32 implementation of getrusage() return EINVAL if being
asked for anything other than RUSAGE_SELF, since it's not supported.
This is never called anywhere in the code today, but might be in
the future.
Not backpatching, since it's not called anywhere today.
-rw-r--r-- | src/port/getrusage.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/port/getrusage.c b/src/port/getrusage.c index f507e5aabed..2cfee586a20 100644 --- a/src/port/getrusage.c +++ b/src/port/getrusage.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/port/getrusage.c,v 1.14 2008/01/01 19:46:00 momjian Exp $ + * $PostgreSQL: pgsql/src/port/getrusage.c,v 1.15 2008/05/14 07:28:13 mha Exp $ * *------------------------------------------------------------------------- */ @@ -41,6 +41,13 @@ getrusage(int who, struct rusage * rusage) FILETIME usertime; ULARGE_INTEGER li; + if (who != RUSAGE_SELF) + { + /* Only RUSAGE_SELF is supported in this implementation for now */ + errno = EINVAL; + return -1; + } + if (rusage == (struct rusage *) NULL) { errno = EFAULT; |