[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 4 Apr 2007 15:18:41 +0400
From: Nikita Danilov <nikita@...sterfs.com>
To: Matt Mackall <mpm@...enic.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 12/13] maps: Add /proc/pid/pagemap interface
Matt Mackall writes:
> Add /proc/pid/pagemap interface
>
> This interface provides a mapping for each page in an address space to
> its physical page frame number, allowing precise determination of what
> pages are mapped and what pages are shared between processes.
[...]
>
> +#ifdef CONFIG_PROC_PAGEMAP
> +struct pagemapread {
> + struct mm_struct *mm;
> + unsigned long next;
> + unsigned long *buf;
> + unsigned long pos;
> + size_t count;
> + int index;
> + char __user *out;
> +};
> +
> +static int flush_pagemap(struct pagemapread *pm)
> +{
> + int n = min(pm->count, pm->index * sizeof(unsigned long));
> + if (copy_to_user(pm->out, pm->buf, n))
> + return -EFAULT;
This pushes binary data to the user space. Wasn't /proc supposed to be
ascii-based to avoid compatibility problems (e.g., size of unsigned long
changing, endianness, etc.)?
Nikita.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists