Re: mbuf data access (repost)
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com To make the copy, you can use mbuf_dup. -josh On Jun 13, 2006, at 11:30 AM, Peter Lovell wrote: On Jun 12, 2006, at 4:46 AM, jy.cases@mac.com wrote: On 7 juin 06, at 19:26, Josh Graessley wrote: Is there a way to find out if those mbufs are shared ? Cheers.....Peter _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/jgraessley%40apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com Peter is correct. You can use mbuf_mclhasreference to determine if you need to copy the mbuf before modifying the data. mbuf_len like mbuf_data works whether or not MBUF_EXT is set. MBUF_EXT just indicates that the actual implementation of the mbuf is storing the data in an external cluster and not in the mbuf data structure itself. The one reason this would be important to a client of the mbuf is the case where you may modify data. In some cases, the reference to the external cluster may be shared. It looks to me as though mbuf_mclhasreference may do what you want. That's in the code but doesn't seem to have a documentation entry. Check bsd/kern/kpi_mbuf.c to see if it's what you need This email sent to jgraessley@apple.com smime.p7s
participants (1)
-
Josh Graessley