From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: About intercepting linux system call
Date: Fri, 28 Jan 2005 02:10:36 +0000 [thread overview]
Message-ID: <16889.40732.94252.216203@napali.hpl.hp.com> (raw)
In-Reply-To: <b3b26beb05012620543066d40@mail.gmail.com>
>>>>> On Fri, 28 Jan 2005 10:04:33 +0800, JinShan Xiong <jinshan.xiong@gmail.com> said:
JinShan> Hi David, I don't know how to use the stub code, I have
JinShan> tried to copy it to overload sys_gettimeofday(), like this,
JinShan> memcpy(sys_call_table[__NR_gettimeofday - 1024],
JinShan> new_time_stub, 32),
JinShan> it crashed the kenrel also.
JinShan> Please help me!
sys_call_table[__NR_gettimeofday - 1024] would have to be set to the
entry-point of new_time_stub. If you declare new_time_stub as a
function, you'd have to do this like so:
extern void new_time_stub (whatever...);
struct fptr { void *ip, void *gp };
sys_call_table[__NR_gettimeofday - 1024] ((struct fptr *) &new_time_stub)->ip;
--david
next prev parent reply other threads:[~2005-01-28 2:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-27 4:54 About intercepting linux system call JinShan Xiong
2005-01-27 5:27 ` Randy.Dunlap
2005-01-27 5:32 ` David Mosberger
2005-01-27 7:17 ` JinShan Xiong
2005-01-27 12:29 ` JinShan Xiong
2005-01-28 2:04 ` JinShan Xiong
2005-01-28 2:10 ` David Mosberger [this message]
2005-01-28 4:05 ` JinShan Xiong
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=16889.40732.94252.216203@napali.hpl.hp.com \
--to=davidm@napali.hpl.hp.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox