Subject: Re: direct copy() between two proc address spaces
To: Ian Zagorskih <ianzag@megasignal.com>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 06/19/2004 16:30:35
--5QAgd0e35j3NYeGe
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Jun 19, 2004 at 06:46:43PM +0700, Ian Zagorskih wrote:
>=20
> In short: Inside kernel, is it possibly to directly copy data from addres=
s=20
> space of one process to address space of another process ?
>=20
> According to man pages there are copyin()/copyout() functions which move =
data=20
> from user space to kernel space and back. In my case, i have two processe=
s=20
> struct proc *p1 and *p2 and i need to copy some block of data between p1 =
and=20
> p2.
>=20
> Of course i can manually allocate temporary buffer inside kernel, copy da=
ta in=20
> buffer from p1, copy data from buffer to p2 and free buffer. But this is=
=20
> quite significant overhead and unneeded operations. Is there some direct =
way=20
> to do this ?

Why do you want to do this? Usually this is handled by using either SysV=20
shared memory, or having both processes mmap the same file. Then you have=
=20
userland directly copy fron one place to the other.

Take care,

Bill

--5QAgd0e35j3NYeGe
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFA1MybWz+3JHUci9cRAvwcAJ90uyScg85hwjfp3yUmi2C/tXYhZgCeJPA3
LBMUtp2Rs/qYQo3PoO6ZCyo=
=MZgT
-----END PGP SIGNATURE-----

--5QAgd0e35j3NYeGe--