Wayland (& gstreamer) uses fd-passing to implement zero copy of graphics-textures/video frames across process. this is typically used in conjunction with buffers allocated by a mechanism like dmabuf which allocates a memory area and provides a fd associated with it to userland. this (translated) fd can be used by the other process to map the same region of memory.
The linked code example doesn't seem to do fd passing, but I guess the use case of fd passing in shared memory context would be the other way around: passing fd's that point to shared memory. The shared memory could then be mmap'ed using the passed fd as the handle.