From: Maciej Golebiewski <maciej@ccrl-nece.technopark.gmd.de>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] /proc/pid/mem and stack variables
Date: Fri, 12 Jan 2001 16:20:20 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590693005037@msgid-missing> (raw)
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
next reply other threads:[~2001-01-12 16:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-12 16:20 Maciej Golebiewski [this message]
2001-01-12 18:45 ` [Linux-ia64] /proc/pid/mem and stack variables 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-ia64-105590693005037@msgid-missing \
--to=maciej@ccrl-nece.technopark.gmd.de \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.