/*++ /* NAME /* unix_recv_fd 3 /* SUMMARY /* receive file descriptor /* SYNOPSIS /* #include <iostuff.h> /* /* int unix_recv_fd(fd) /* int fd; /* DESCRIPTION /* unix_recv_fd() receives a file descriptor via the specified /* UNIX-domain socket. The result value is the received descriptor. /* /* Arguments: /* .IP fd /* File descriptor that connects the sending and receiving processes. /* DIAGNOSTICS /* unix_recv_fd() returns -1 upon failure. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA
/*--*/
int unix_recv_fd(int fd)
{ constchar *myname = "unix_recv_fd";
/* *Thiscodedoesnotworkwithversion<2.2Linuxkernels,anditdoes *notcompilewithversion<2Linuxlibraries.
*/ #ifdef CANT_USE_SEND_RECV_MSG
msg_warn("%s: your system has no support for file descriptor passing",
myname); return (-1); #else struct msghdr msg; int newfd; struct iovec iov[1]; char buf[1];
int main(int argc, char **argv)
{ char *transport; char *endpoint; int listen_sock; int client_sock; int client_fd;
ssize_t read_count; char buf[1024];
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.