From owner-freebsd-hackers Fri Dec 20 10:43:33 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D15B737B401 for ; Fri, 20 Dec 2002 10:43:31 -0800 (PST) Received: from milla.ask33.net (milla.ask33.net [217.197.166.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 43C4143EDA for ; Fri, 20 Dec 2002 10:43:31 -0800 (PST) (envelope-from nick@milla.ask33.net) Received: by milla.ask33.net (Postfix, from userid 1001) id 990073ABB63; Fri, 20 Dec 2002 19:43:37 +0100 (CET) Date: Fri, 20 Dec 2002 19:43:37 +0100 From: Pawel Jakub Dawidek To: freebsd-hackers@freebsd.org Subject: Syscall number. Message-ID: <20021220184337.GD11475@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="+B+y8wtTXqdUj1xM" Content-Disposition: inline X-PGP-Key-URL: http://garage.freebsd.pl/jules.asc X-OS: FreeBSD 4.7-STABLE i386 User-Agent: Mutt/1.5.1i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --+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