summaryrefslogtreecommitdiff
path: root/libhurd-mm
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@gnu.org>2008-11-11 11:18:50 +0100
committerNeal H. Walfield <neal@gnu.org>2008-11-11 11:18:50 +0100
commitbb8872946093818f0766f90cb9cc4af17337ad38 (patch)
tree15a6841c4d8e9c09a81fa44518159325360e40ae /libhurd-mm
parent78c04c770ebc968dcdd6188f3b229aa4165c1284 (diff)
Add debugging output when passing bad arguments to madvise.
2008-11-11 Neal H. Walfield <neal@gnu.org> * madvise.c (madvise): Add debugging output for bad arguments.
Diffstat (limited to 'libhurd-mm')
-rw-r--r--libhurd-mm/ChangeLog4
-rw-r--r--libhurd-mm/madvise.c12
2 files changed, 12 insertions, 4 deletions
diff --git a/libhurd-mm/ChangeLog b/libhurd-mm/ChangeLog
index 5dffdea..032407e 100644
--- a/libhurd-mm/ChangeLog
+++ b/libhurd-mm/ChangeLog
@@ -1,5 +1,9 @@
2008-11-11 Neal H. Walfield <neal@gnu.org>
+ * madvise.c (madvise): Add debugging output for bad arguments.
+
+2008-11-11 Neal H. Walfield <neal@gnu.org>
+
* anonymous.c: Include <profile.h>.
(fault): Profile.
diff --git a/libhurd-mm/madvise.c b/libhurd-mm/madvise.c
index 5bdb962..d3985c2 100644
--- a/libhurd-mm/madvise.c
+++ b/libhurd-mm/madvise.c
@@ -32,9 +32,15 @@ int
madvise (void *addr, size_t length, int advice)
{
if (((uintptr_t) addr & (PAGESIZE - 1)) != 0)
- return EINVAL;
+ {
+ debug (0, "Address %x not multiple of pagesize.", addr);
+ return EINVAL;
+ }
if ((length & (PAGESIZE - 1)) != 0)
- return EINVAL;
+ {
+ debug (0, "Length %x not multiple of pagesize.", addr);
+ return EINVAL;
+ }
switch (advice)
{
@@ -60,8 +66,6 @@ madvise (void *addr, size_t length, int advice)
uintptr_t start = (uintptr_t) addr;
uintptr_t end = start + length - 1;
- debug (0, "(%p, %x (%p), %d)", addr, length, end, advice);
-
struct region region = { (uintptr_t) addr, length };
maps_lock_lock ();