Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bsd sockets in a kext



Hi, Stephane,

On Friday, March 8, 2002, at 03:51 AM, Stephane ODUL wrote:

I9m writing a driver to handle multimedia key for a usb keyboard.

My kext need to send message to a user process daemon.

I9ve tried to setup the communication using the bsd sockets. My daemon
compile fine but the when I build the kext I have an error saying functions
like socket() are not declared while <sys/socket.h> is included.

Maybe I9m not using the good solution. Help me I ve been stucked on this for
3 days now.

I'm not sure what the problem is. Are you using 'socket(2)' in the user-space daemon, or in the kext? You can't use user-space calls in the kernel, because the operating environments are completely different.

You will need to use kernel versions of the user-mode calls in your kext. There isn't any good documentation on this, but you can refer to the Wright/Stevens book (TCP/IP Illustrated, V2) for descriptions of the in-kernel code; and you can look at the 'xnu' source from Darwin for examples of this use, in NFS (xnu/bsd/nfs) and in the AURP code (xnu/bsd/netat/aurp*).

This has also been discussed on the Darwin lists, so you might get some good pointers from the archives.

Regards,

Justin

--
Justin C. Walker, Curmudgeon-At-Large *
Institute for General Semantics | It's not whether you win or lose...
| It's whether *I* win or lose.
*--------------------------------------*-------------------------------*
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.
References: 
 >Bsd sockets in a kext (From: Stephane ODUL <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.