transfer an open file description between two process

How can I transfer an open file description between two process?

The two processes must connect to each other by using a unix domain socket. Then the process that has the open file descriptor needs in invoke the sendmsg() system call. The receiving process invokes the recvmsg() system call. When you look up these system calls, they will talk about passing "access rights". That refers to this concept. Actually, the file descriptor itself isn't passed. It's just that the receiving program opens a file descriptor that points to the same entry in the file table as the file descriptor that was used in the sendmsg(). So in most cases it won't be the numerically same fd.