Re: ctl_enqueuedata ENOBUFS error
Re: ctl_enqueuedata ENOBUFS error
- Subject: Re: ctl_enqueuedata ENOBUFS error
- From: Allan Hoeltje <email@hidden>
- Date: Tue, 12 Jul 2005 12:28:22 -0700
"Justin C. Walker" <email@hidden> wrote on 7/12/05 11:57 AM:
> This is short, due to lack of time:
Justin, everything you have said so far I treat as pure gold. Thank you for
all the time you have spent on my problem so far.
> I mean: ENOBUFS usually means no space of some kind - either no
> buffers or no space to put buffers in, depending. Since this is not
> a common problem for existing code, it seems likely that it is due to
> something you are doing, presumably incorrectly.
To what existing code do you refer? I have Googled and Spotlighted for
kern_ctl_reg, ctl_enqueuedata, mbuf_copydata, and only find the Apple docs
that I have mentioned before. I see no sample code of any kind on the web.
> You should be aware that the mbuf accounting rules take into account
> all the space in an mbuf, whether you use it or not (e.g., if you
> allocate an mbuf with cluster, put 1 byte in the cluster, and enqueue
> it, you are docked for the size of the mbuf (256 bytes) + size of
> cluster (2048 bytes). You may already know this but it's worth
> emphasizing.
I am not, as far as my code goes, allocating any mbufs. I am accessing the
data in the mbuf passed to me in my ipf_input_func but I do not free it nor
allocate any other mbuf. The data I send via ctl_enqueuedata is _MALLOC'd
and _FREE'd but it is not an mbuf.
> This is a no-whining zone.
Oh, now you tell me! :-)
> When the going gets tough, the tough get
> the kernel source and look at it to figure out what *might* be going
> wrong...
> ...There are no courses on
> kernel internals, generally, and precious little documentation. You
> need to dig into the source.
> Hope this helps.
Yes that helps very much. Knowing that the only place to really learn this
stuff is by looking directly at Darwin is the best piece of information I've
gotten to date. The Apple docs should say that and then emphasize it in the
section where they warn us about writing KEXTs.
Thanks!
-Allan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden