这是lib辅助测试,为什么parent_process发送1,2,但是child_process接收是3,5?
按照代码,这是lib辅助测试:
void child_process(int sock)
{
int fds[3], nfds;
//rece fd is 3,5
nfds = ancil_recv_fds(sock, fds, 3);
if(nfds < 0) {
perror("ancil_recv_fds");
exit(1);
}
}
void parent_process(int sock)
{
int fds[2] = { 1, 2 };
if(ancil_send_fds(sock, fds, 2)) {
perror("ancil_send_fds");
exit(1);
}
}