<?xml version='1.0'?> <!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
        "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

<refentry id="kdbus_fs">

  <refentryinfo>
    <title>kdbus.fs</title>
    <productname>kdbus.fs</productname>
  </refentryinfo>

  <refmeta>
    <refentrytitle>kdbus.fs</refentrytitle>
    <manvolnum>7</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>kdbus.fs</refname>
    <refpurpose>kdbus file system</refpurpose>
  </refnamediv>

  <refsect1>
    <title>File-system Layout</title>

    <para>
      The <emphasis>kdbusfs</emphasis> pseudo filesystem provides access to
      kdbus entities, such as <emphasis>buses</emphasis> and
      <emphasis>endpoints</emphasis>. Each time the filesystem is mounted,
      a new, isolated kdbus instance is created, which is independent from the
      other instances.
    </para>
    <para>
      The system-wide standard mount point for <emphasis>kdbusfs</emphasis> is
      <constant>/sys/fs/kdbus</constant>.
    </para>

    <para>
      Buses are represented as directories in the file system layout, whereas
      endpoints are exposed as files inside these directories. At the top-level,
      a <emphasis>control</emphasis> node is present, which can be opened to
      create new buses via the <constant>KDBUS_CMD_BUS_MAKE</constant> ioctl.
      Each <emphasis>bus</emphasis> shows a default endpoint called
      <varname>bus</varname>, which can be opened to either create a connection
      with the <constant>KDBUS_CMD_HELLO</constant> ioctl, or to create new
      custom endpoints for the bus with
      <constant>KDBUS_CMD_ENDPOINT_MAKE</constant>. See
      <citerefentry>
        <refentrytitle>kdbus.bus</refentrytitle>
        <manvolnum>7</manvolnum>
      </citerefentry>,
      <citerefentry>
        <refentrytitle>kdbus.connection</refentrytitle>
        <manvolnum>7</manvolnum>
      </citerefentry> and
      <citerefentry>
        <refentrytitle>kdbus.endpoint</refentrytitle>
        <manvolnum>7</manvolnum>
      </citerefentry>
      for more details.
    </para>

    <para>Following, you can see an example layout of the
    <emphasis>kdbusfs</emphasis> filesystem:</para>

<programlisting>
        /sys/fs/kdbus/                          ; mount-point
        |-- 0-system                            ; bus directory
        |   |-- bus                             ; default endpoint
        |   `-- 1017-custom                     ; custom endpoint
        |-- 1000-user                           ; bus directory
        |   |-- bus                             ; default endpoint
        |   |-- 1000-service-A                  ; custom endpoint
        |   `-- 1000-service-B                  ; custom endpoint
        `-- control                             ; control file
</programlisting>
  </refsect1>

  <refsect1>
    <title>Mounting instances</title>
    <para>
      In order to get a new and separate kdbus environment, a new instance
      of <emphasis>kdbusfs</emphasis> can be mounted like this:
    </para>
<programlisting>
  # mount -t kdbusfs kdbusfs /tmp/new_kdbus/
</programlisting>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <simplelist type="inline">
      <member>
        <citerefentry>
          <refentrytitle>kdbus</refentrytitle>
          <manvolnum>7</manvolnum>
        </citerefentry>
      </member>
      <member>
        <citerefentry>
          <refentrytitle>kdbus.bus</refentrytitle>
          <manvolnum>7</manvolnum>
        </citerefentry>
      </member>
      <member>
        <citerefentry>
          <refentrytitle>kdbus.connection</refentrytitle>
          <manvolnum>7</manvolnum>
        </citerefentry>
      </member>
      <member>
        <citerefentry>
          <refentrytitle>kdbus.endpoint</refentrytitle>
          <manvolnum>7</manvolnum>
        </citerefentry>
      </member>
      <member>
        <citerefentry>
          <refentrytitle>mount</refentrytitle>
          <manvolnum>8</manvolnum>
        </citerefentry>
      </member>
    </simplelist>
  </refsect1>
</refentry>
