Re: Using ctl_enqueuembuf
Re: Using ctl_enqueuembuf
- Subject: Re: Using ctl_enqueuembuf
- From: Justin Walker <email@hidden>
- Date: Wed, 20 Apr 2005 13:17:51 -0700
On Apr 20, 2005, at 13:01, Carl Smith wrote:
Oh sorry.
In my kernel I use the function 'int ctl_register(struct kern_ctl_reg
*userctl, void *userdata, kern_ctl_ref *ctlref)'. In my code it looks
like
Ctl_register(My_kern_ctl_struct, 0, &my_kern_ctl_ref);
Now in kernel_control calls I would use the returned value in
my_kern_ctl_ref in subsequent calls to functions like ctl_enqueuembuf,
as follows: ctl_enqueuembuf(my_kern_ctl_ref, my_mbuf, myFlags);
[snip]
so I am asking seeing as how ctl_enqueuembuf can obtain the struct
sockbuf pointer from my_kern_ctl_ref, can I also obtain a socket
descriptor from my_kern_ctl_ref?
You are slightly confused. Socket descriptors are user-mode gizmos,
namely, file descriptors that are returned by the socket() call.
Nothing in the kernel uses file descriptors (save for those calls that
manipulate them on behalf of the user).
In short how can I find/obtain the socket descriptor(int) that the
kernel is currently talking/connected to?
I'm still not clear on what you want. For a start, review the
kern_control source (xnu/bsd/kern/kernel_control.c) to see how things
are set up. I don't know that there is any source that currently uses
this stuff (to use as an example); someone else will have to answer
that.
Regards,
Justin
--
Justin C. Walker, Curmudgeon at Large
Institute for General Semantics
-----------
My wife 'n kids 'n dog are gone,
I can't get Jesus on the phone,
But Ol' Milwaukee's Best is my best friend.
-----------
_______________________________________________
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