summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander2008-05-14 07:28:13 +0000
committerMagnus Hagander2008-05-14 07:28:13 +0000
commit6940c4b2b2ee7a5616d85671ef68d1d9507607fe (patch)
treea2542a0e07da6a1aad6b800efef9d63712ab80f1
parentc685bd11b5611372c48f0b3aa4f12df872af9696 (diff)
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.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/port/getrusage.c b/src/port/getrusage.c
index 86edadc2b6..c56926763c 100644
--- a/src/port/getrusage.c
+++ b/src/port/getrusage.c
@@ -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;