[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Memory copy
On Mon, Mar 10, 2003 at 12:45:40PM +0000, Miguel wrote:
> this is not a real question about kernel programming but about a user
> process... How can I just copy a chunk of memory from a process to
> another? Is there a simple memcpy-like call or is it necessary to use
> another method, like shared memory, or pipes?
mmap(2), sysv shared memory, (does linux do posix shared memory?),
pipes (named and unnamed), sockets (unix domain or tcp/ip for easy
distributability)..
All sorts of cool options. :)
I'd expect mmap(2) and sysv shm to be the most portable when you want to
share a lot of memory, and unix domain sockets or tcp/ip sockets to be
most useful when you want to share a stream of bytes, rather than shared
random-access modification of bytes..
W. Richard Stevens has written a book dedicated to interprocess
communication under Unix systems. Recommended reading, as is everything
he wrote.
I hope this helps
--
"Nothing says, 'Superpower' like bombing a country that is poor and
hungry." -- Ken Brush
PGP signature