Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Dec 2002 19:43:37 +0100
From:      Pawel Jakub Dawidek <nick@garage.freebsd.pl>
To:        freebsd-hackers@freebsd.org
Subject:   Syscall number.
Message-ID:  <20021220184337.GD11475@garage.freebsd.pl>

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

--+B+y8wtTXqdUj1xM
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello hackers...

Simple example (from kld module):

sysent[SYS_chmod].sy_call =3D myfunction;
sysent[SYS_open].sy_call =3D myfunction;
sysent[SYS_execve].sy_call =3D myfunction;

int
myfunction(register struct proc *p, register void *uap)
{
	int syscallno;

	syscallno =3D ?

	return (0);
}

How to get syscall number inside myfunction()?

I've always use method used in spy from Andrzej Bialecki:

	syscallno =3D p->p_md.md_regs->tf_eax;

for i386 arch.
But when I catch many syscalls I got false numbers.
Hmm, not false numbers, one false numer: SYS___syscall (and I don't catch i=
t).

So is there some diffrent way to get syscall number (in -STABLE
or in -CURRENT)? Anyone?

--=20
Pawel Jakub Dawidek
UNIX Systems Administrator
http://garage.freebsd.pl
Am I Evil? Yes, I Am.

--+B+y8wtTXqdUj1xM
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iQCVAwUBPgNk2T/PhmMH/Mf1AQF3kAP+OjXHQvI05L2VrhUGL5CTL14gGH5splhG
+noP3XQ225+PuLJRyFvgezTPqBj5Ol9XaQT3YyzLtYQDFWUjSb25xrRlmO0cJmZ0
OD3jD00IV/FkVxyNSmHEXzSB62IF4wt5F7nbOroZ7fHOyqB1WW9UlVQ2AnVqGD/C
+6LpWT/wuBk=
=ZjfK
-----END PGP SIGNATURE-----

--+B+y8wtTXqdUj1xM--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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