Re: Reading large /proc entry from kernel module

From: Peter Chubb
Date: Tue Mar 08 2005 - 18:16:52 EST


>>>>> "Kristian" == Kristian Sørensen <ks@xxxxxxxxx> writes:

Kristian> Hi all! I have some trouble reading a 2346 byte /proc entry
Kristian> from our Umbrella kernel module.


Kristian> static int umb_proc_write(struct file *file, const char *buffer,
Kristian> unsigned long count, void *data) {
Kristian> char *policy;
Kristian> int *lbuf;
Kristian> int i;

Here's your problem: lbuf should be a char * not an int *.
When you look lbuf[0] you'll get the first four characters packed
into the int.
--
Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au
The technical we do immediately, the political takes *forever*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/