From owner-freebsd-hackers Wed Aug 28 11:27:53 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 A7FF637B400 for ; Wed, 28 Aug 2002 11:27:50 -0700 (PDT) Received: from milla.ask33.net (milla.ask33.net [217.197.166.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C78143E6A for ; Wed, 28 Aug 2002 11:27:50 -0700 (PDT) (envelope-from nick@milla.ask33.net) Received: by milla.ask33.net (Postfix, from userid 1001) id E9C1D3ABD43; Wed, 28 Aug 2002 20:30:18 +0200 (CEST) Date: Wed, 28 Aug 2002 20:30:18 +0200 From: Pawel Jakub Dawidek To: Terry Lambert Cc: freebsd-hackers@freebsd.org Subject: Re: Replacing kernel functions. Message-ID: <20020828183018.GL31943@garage.freebsd.pl> References: <20020828021016.GB31943@garage.freebsd.pl> <3D6C3F16.EC09BDB@mindspring.com> <20020828102902.GF31943@garage.freebsd.pl> <3D6CBC0B.A94B7197@mindspring.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="nrM5Z5VIJgwP9LWp" Content-Disposition: inline In-Reply-To: <3D6CBC0B.A94B7197@mindspring.com> X-PGP-Key-URL: http://garage.freebsd.pl/jules.pgp X-OS: FreeBSD 4.6-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 --nrM5Z5VIJgwP9LWp Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 28, 2002 at 05:03:23AM -0700, Terry Lambert wrote: +> -- Terry Thanks to Your help I've found maybe better way to do this. I could catch open(), and: int myopen(struct proc *p, struct open_args *uap) { int ret; if ((ret =3D open(p, uap)) !=3D 0) return (ret); /* * And here I can cache uap->name and change close() function address, * where address of those functions is here: * p->p_fd->fd_ofiles[p->p_retval[0]]->f_ops->fo_close */ return (0); } This is much more complicated, because if I will change address of this function, it changes for every descriptor on this file system. So I need cache original address of fo_close() functions, etc. But this should works, I'm testing it at the moment. --=20 Pawel Jakub Dawidek UNIX Systems Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am. --nrM5Z5VIJgwP9LWp Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iQCVAwUBPW0Wuj/PhmMH/Mf1AQF9xAQAjTNv/q8rrUBZeaBXsBTZxlXEJZsNMmXV tOQd5hQFJ8VAEC4VZn6wC9RGuatR9rHvxrNEGqeSxEfT5tFWZsjjmNGiea4rTm+x spxT1lHj8aobTx4BCUZLoj5D2yUUKaLAHWHeaV/UAeWlJoucEMRZzttKCnyS/FlS aABRIhFYq8s= =VgJT -----END PGP SIGNATURE----- --nrM5Z5VIJgwP9LWp-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message