public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] /proc/pid/mem and stack variables
@ 2001-01-12 16:20 Maciej Golebiewski
  2001-01-12 18:45 ` Pete Wyckoff
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Maciej Golebiewski @ 2001-01-12 16:20 UTC (permalink / raw)
  To: linux-ia64

Hello everyone,

I'm new on this list. I looked through the archives but could not
find answer to my problem.

I have a library that makes use of /proc/pid/mem entries in the
/proc pseudo-filesystem. It runs perfectly on IA32 under 2.2.12
(and some superficial tests suggest that it works under
2.4.0-test12 as well).

I have recompiled the library on IA64 under 2.4.0-test12
and using version 2.9-ia64-000216-final. The library works
OK except when the address it tries to access via /proc/pid/mem
refers to variables allocated on stack (e.g. local arrays defined
in functions).

This is a snippet of code used to access memory via /proc/pid/mem:

void mem_read (int fd, void *buf, void *addr, size_t len) {

	if (lseek (fd, (off_t)addr, SEEK_SET) == (off_t)-1)
                perror ("lseek");
	read (fd, buf, len);

lseek in this code fails (EINVAL) always when addr is address of
a variable allocated on stack.

I have no idea if the problem is because I'm doing something
wrong, or because /proc/pid/mem is not yet fully implemented on IA64.
I appreciate any hints and help with this.

Thanks in advance,

Maciej

-- 
Maciej Go³êbiewski
golebiewski@ccrl-nece.de
http://www.ccrl-nece.technopark.gmd.de/~maciej
C&C Research Laboratories, NEC Europe Ltd., Sankt Augustin, Germany


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-01-18  2:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-12 16:20 [Linux-ia64] /proc/pid/mem and stack variables Maciej Golebiewski
2001-01-12 18:45 ` Pete Wyckoff
2001-01-13  2:29 ` David Mosberger
2001-01-15 10:17 ` Maciej Golebiewski
2001-01-15 17:57 ` Erich Focht
2001-01-18  2:48 ` David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox