Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
シナリオは次のようになります。
Linux ベースのハンドヘルド デバイスには、サード パーティのアプリからすぐに呼び出せる dbus API を持つ C アプリがあります。DBus API は、起動時に呼び出されます。
関数で呼び出し元の ID を出力して syslog に保存するために使用できるシステム API はありますか?
前もって感謝します!
/org/freedesktop/DBusバス上のオブジェクトにはorg.freedesktop.DBus、インターフェイスに属する2つのメソッドがありorg.freedesktop.DBusます(まあ):GetConnectionUnixUserとGetConnectionUnixProcessID。dbus_message_get_senderどちらも文字列を受け入れます。これは、呼び出し(または高レベルのAPIラッパーが提供する任意のメソッド)によって取得できる一意の接続名です。
/org/freedesktop/DBus
org.freedesktop.DBus
GetConnectionUnixUser
GetConnectionUnixProcessID
dbus_message_get_sender