logo
Free, Micro AI Code Reviews That Run on Git Commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, Micro AI Code Reviews That Run on Git Commit | Product Hunt git-lrc - Free, Micro AI Code Reviews That Run on Git Commit | Product Hunt

io_passfd - pass a file descriptor over a Unix Domain socket

Description

       io_passfd  transfers  the  file  descriptor  fd  over  the Unix Domain socket sock.  This works much like
       dup(2), only that the copy of the descriptor appears not in this process but at the other end of the Unix
       Domain socket (which therefore must be a process on the same system).

       The peer can then use io_receivefd(3) to receive the file descriptor.

       Note that the passed descriptor stays open in the sending process.

Name

       io_passfd - pass a file descriptor over a Unix Domain socket

Return Value

       io_passfd returns 0 on success, -1 on error (setting errno accordingly).

See Also

io_receivefd(3)

                                                                                                    io_passfd(3)

Syntax

#include<libowfat/io.h>

       int io_passfd(int64 sock,int64 fd);

See Also