site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Thread-index: AcVF3k+DOnsCHH3GS9WbN7DIakENhgAAbIWg Thread-topic: Using ctl_enqueuembuf 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); Looking at the ctl_enqueuembuf source code, I see that ctl_enqueuembuf uses sbappend(), and to get sbappend to work ctl_enqueuembuf does this: ctl_enqueuembuf (void *ctlref, struct mbuf *m, u_int32_t flags) { Struct ctl *ctl = (struct ctl *)ctlref; Struct socket *so = (struct socket*)ctl->skt; ...... sbappend(&so->so_rcv, m); ..... return 0; } 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? In short how can I find/obtain the socket descriptor(int) that the kernel is currently talking/connected to? Thanks Carl -----Original Message----- From: darwin-kernel-bounces+csmith=fortresstech.com@lists.apple.com [mailto:darwin-kernel-bounces+csmith=fortresstech.com@lists.apple.com] On Behalf Of Justin Walker Sent: Wednesday, April 20, 2005 3:22 PM To: darwin-kernel Dev Subject: Re: Using ctl_enqueuembuf On Apr 20, 2005, at 12:01, Carl Smith wrote: [snip]
So say I want to use a sendto or write, I used 'ctl_register()' in my kernel to register my Kernel Controller, is there some way to obtain the socket fd that sendto() or write() require using the kern_ctl_ref return by the call to ctl_register()?
Sorry, Carl. I can't parse this sentence. Can you rephrase? 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/csmith%40fortresste ch.com This email sent to csmith@fortresstech.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
participants (1)
-
Carl Smith