This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fstat on sockets broken


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]