Web lists-archives.com

Re: RFC: GtkPreview library

On 27/01/15 15:55, Jasper St. Pierre wrote:
> Wayland requires two features that would perhaps make it unportable: FD
> passing (SCM_CREDENTIALS), and shared memory (allocate a temporary
> files, ftruncate it, mmap it, unlink it and then send the fd across the
> wire). Everything else is just a simple Unix domain socket. Does OS X
> support those two features?

I think you mean SCM_RIGHTS?

SCM_RIGHTS is "here's a message with an open fd attached". It's how
D-Bus does fd-passing, so if D-Bus fd-passing works on your favourite
platform, Wayland fd-passing should too.

SCM_CREDENTIALS is "here's a message with my uid, gid and pid[1]
attached, the kernel will check that I haven't lied to you" (also called
SCM_CREDS on e.g. FreeBSD). Basically every Unix has either this or a
syscall to query those things or both, but most Unixes also have their
own unique spelling for the API, because standards are hard.[2]


[1] Strictly speaking "the uid, gid and pid I had at the time I opened
this socket"
[2] Except that FreeBSD, Dragonfly BSD and Hurd share SCM_CREDS, and
several platforms (sadly not including Linux) share getpeereid(). For
the gory details see libdbus source code.

gtk-devel-list mailing list