Re: dynamic linking
[email protected] (Paul Jarc)
| Newsgroups | gmane.comp.djb.package |
|---|---|
| Organization | What did you have in mind? A short, blunt, human pyramid? |
| Message-ID | <[email protected]> |
Uwe Ohse <[email protected]> wrote: > On Mon, Jun 10, 2002 at 11:14:21AM -0400, Paul Jarc wrote: >> If you want to exchange structured data with other code, and you're >> communicating with that code via pipes, then you must use parsing >> (when reading) and quoting (when writing) to serialize the data over >> the pipe. > > No. It's easier than that: You just pass a byte counter and the data. It isn't that easy when the structure contains references to other structures. >> OTOH, with shared libraries, you can just pass pointers to >> structures; no serialization is needed. > > You can't pass pointer between applications. Shared libraries under unix > share code, not data. This is not windows. Consider "stat(filename, &statbuf)" where stat lives in a shared libc. filename and &statbuf are pointers to data from the program. The stat function can access the pointed-to data because for this call, it runs in the same address space as the program. paul