fstat on sockets broken

David E Euresti davie@MIT.EDU
Fri Jun 7 16:12:00 GMT 2002


Hello,

The following code returns with
  fstat: No such file or directory
which is not what unix does.
I can work around it but just thought I'd let you know.

#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
int main() {
  struct stat sbuf;
  int fd = socket(AF_INET, SOCK_STREAM, 0);
  if (fstat(fd, &sbuf) < 0) {
    printf("fstat: %s\n", strerror(errno));
    exit(0);
  }
}


David


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list