Can I bind a file descriptor returned by open call to a socket?
I am trying to do something like,
filefd = open("path",O_RDWR);
...
bind (filefd, (struct sockaddr *) &servaddr, sizeof(servaddr));
connfd = accept (filefd, (struct sockaddr *) &cliaddr, &clilen);
Why does the accept call return -1?