Off-topic: D-Bus in the kernel

Rémi Denis-Courmont remi at
Fri Sep 17 20:21:17 PDT 2010


On Saturday 18 September 2010, Alban Crequy wrote:
> Le Fri, 17 Sep 2010 14:07:26 -0400,
> Ray Strode <halfline at> a écrit :
> > Hi,
> > 
> > > So I could test a full GNOME session (and also N900) with AF_DBUS
> > > without implementing the bus driver in the kernel.
> > 
> > So this puts the session bus in the kernel?
> It depends what is in /etc/dbus-1/{session,system}.conf. If there is:
>   <listen>unix:tmpdir=/tmp</listen>
> it uses the usual AF_UNIX sockets. If I change it to:
>   <listen>dbus:path=/tmp/kdbus</listen>
> then it use AF_DBUS sockets with kdbus.

I expect such an abomination to be burnt in flames on the kernel mailing list. 
There is no file "type" for DBus bus, so you simply cannot use the file system 
for this - only Unix/local domain sockets are allowed to sit there. Anything 
else will break stat() semantics, in my understanding.

You should really consider using something else for the sockaddr. It can be as 
simple as an unique integer automatically assigned when listen() gets called, 
fetched with getsockname(). As an added bonus, it becomes trivial to start 
DBus early in the boot.

Rémi Denis-Courmont

More information about the dbus mailing list