Martin Englund <[EMAIL PROTECTED]> wrote:
> I'm working on a command line tool that communicates with a daemon, using
> libdoor(3LIB), to retrieve events (malloc()ed structs of variable length)
> which sit on a ring buffer.
>
> My problem is that once I've picked up an event from the ring buffer I want
> to free() it, but I can't do that until I've called door_return(), but once
> I've called door_return() I'm no longer executing in the server process.
If you copy the return data to door_arg->data_ptr, you may free it before
you call door_return().
If you like to return it via the door_return(char *data_ptr,
you could first copy it to an autromatic variable and then
free the original. And you could just use alloca() to get
the data space.
Jörg
--
EMail:[EMAIL PROTECTED] (home) Jörg Schilling D-13353 Berlin
[EMAIL PROTECTED] (uni)
[EMAIL PROTECTED] (work) Blog: http://schily.blogspot.com/
URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code