Sending file descriptor by Linux socket
问题 I am trying to send some file descriptor by linux socket, but it does not work. What am I doing wrong? How is one supposed to debug something like this? I tried putting perror() everywhere it\'s possible, but they claimed that everything is ok. Here is what I\'ve written: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/wait.h> #include <sys/socket.h> #include <sys/types.h> #include <fcntl.h> void wyslij(int socket, int fd) // send fd by socket {