summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2011-12-13 06:47:21 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2011-12-13 06:47:21 +0000
commit66496446db44ed793dff3a05a6a68f13d0815e41 (patch)
treee78172f626c2a6751f54b1566a9c6c5acdc294fd
parent055e6685691721952934cecd60142ee720e906e5 (diff)
2011-12-13 Ralf Corsépius <ralf.corsepius@rtems.org>
* configure.ac: Check for getrusage.h decl. * libcsupport/src/getrusage.c: Apply HAVE_DECL_GETRUSAGE (Missing prototypes).
-rw-r--r--cpukit/ChangeLog6
-rw-r--r--cpukit/configure.ac3
-rw-r--r--cpukit/libcsupport/src/getrusage.c4
3 files changed, 13 insertions, 0 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 63c179edb6..78ab1ca388 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,9 @@
+2011-12-13 Ralf Corsépius <ralf.corsepius@rtems.org>
+
+ * configure.ac: Check for getrusage.h decl.
+ * libcsupport/src/getrusage.c:
+ Apply HAVE_DECL_GETRUSAGE (Missing prototypes).
+
2011-12-12 Sebastian Huber <sebastian.huber@embedded-brains.de>
* score/src/wkstringduplicate.c: New file.
diff --git a/cpukit/configure.ac b/cpukit/configure.ac
index 03e0f1e726..e3c6a59e74 100644
--- a/cpukit/configure.ac
+++ b/cpukit/configure.ac
@@ -98,6 +98,9 @@ RTEMS_CHECK_FUNC([pthread_attr_setguardsize],[#include <pthread.h>])
RTEMS_CHECK_FUNC([pthread_attr_setstack],[#include <pthread.h>])
RTEMS_CHECK_FUNC([pthread_attr_getstack],[#include <pthread.h>])
+# Mandated by POSIX, not declared in some versions of newlib.
+AC_CHECK_DECLS([getrusage],,,[#include sys/resource.h])
+
# Newlib's unix/ directory
AC_CHECK_FUNCS([ttyname getcwd])
# </FIXME>
diff --git a/cpukit/libcsupport/src/getrusage.c b/cpukit/libcsupport/src/getrusage.c
index df68376e50..599af833b0 100644
--- a/cpukit/libcsupport/src/getrusage.c
+++ b/cpukit/libcsupport/src/getrusage.c
@@ -19,6 +19,10 @@
#include <rtems.h>
#include <rtems/seterr.h>
+#if !HAVE_DECL_GETRUSAGE
+extern int getrusage(int who, struct rusage *usage);
+#endif
+
int getrusage(int who, struct rusage *usage)
{
struct timespec uptime;