Working around platform limitations on GetConnectionUnixProcessID?

René J.V. Bertin rjvbertin at gmail.com
Sat Apr 19 22:37:50 UTC 2025


On Sunday April 20 2025 10:11:48 Lawrence D'Oliveiro wrote:

>Surely, that is built on top of getsockopt(... SO_PEERCRED ...), which
>should be supported on the BSDs. From which macOS/Darwin is derived.

It still fails with a permissions error in DBus 1.14 installed via MacPorts; judging from the dates in

>Seems there was also an issue with lack of socketpair(2) support, but
>that has now been fixed
><https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=176419>.

that version should have the fix, AFAICT?

Darwin is some the userland from some BSD flavour on top of a Mach kernel. That's where the issue could be.

Adding a method to return the own PID was a piece of cake in a Qt-based application. Reading the value from the returned `(a{sv})` container in a GLib-based application was a lot more trial-and-error work...


More information about the dbus mailing list