From owner-freebsd-hackers Sat Dec 21 9:47:25 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 6E6B937B401 for ; Sat, 21 Dec 2002 09:47:24 -0800 (PST) Received: from bluejay.mail.pas.earthlink.net (bluejay.mail.pas.earthlink.net [207.217.120.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC0C243ED8 for ; Sat, 21 Dec 2002 09:47:23 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from [216.20.231.174] (helo=mindspring.com) by bluejay.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 18PniQ-0006w4-00; Sat, 21 Dec 2002 09:47:11 -0800 Message-ID: <3E04A8D2.C6CDBF6A@mindspring.com> Date: Sat, 21 Dec 2002 09:45:54 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Pawel Jakub Dawidek Cc: freebsd-hackers@freebsd.org Subject: Re: Syscall number. References: <20021220184337.GD11475@garage.freebsd.pl> <20021221032233.GG11475@garage.freebsd.pl> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4cdb10f658046335ee308dc6da63e2b4c93caf27dac41a8fd350badd9bab72f9c350badd9bab72f9c 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 Pawel Jakub Dawidek wrote: > On Fri, Dec 20, 2002 at 07:43:37PM +0100, Pawel Jakub Dawidek wrote: > +> Simple example (from kld module): > +> > +> sysent[SYS_chmod].sy_call = myfunction; > +> sysent[SYS_open].sy_call = myfunction; > +> sysent[SYS_execve].sy_call = myfunction; [ ... ] > Ok, I've found solution (ripped from trap.c, ehh). This is actually a bad way to do things. There is a system call loadable module type, and you should use that instead of directly accessing the system call entry table and stomping on values without asserting appropriate locks. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message