Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 May 2003 13:41:58 +0200
From:      Alan Robinson <alan.robinson@fujitsu-siemens.com>
To:        freebsd-ia64@freebsd.org
Subject:   /dev/kmem read return value is double requested value
Message-ID:  <20030528134139.A17162@fujitsu-siemens.com>

next in thread | raw e-mail | index | archive | help

Hi Folks,

I was playing with a user-land program that read some data out
of the kernel memory and noticed that the read() return value was
twice what I was expecting. I think the error is in the mmrw() function
in file ia64/ia64/mem.c, removing the following lines seems to 
fix the problem.

                iov->iov_base = (char *)iov->iov_base + c;
                iov->iov_len -= c;
                uio->uio_offset += c;
                uio->uio_resid -= c;

I had a little look at some of the other ARCH/ARCH/mem.c and some others
seem to contain the same problem.

Note that the actual data transfered is OK, just the read() return value
and the file offset are wrong.


Alan
PS If this is fixed will it help get gdb working :-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030528134139.A17162>