Added handling for std handles.
authorHartmut Birr <osexpert@googlemail.com>
Mon, 1 Apr 2002 22:03:56 +0000 (22:03 +0000)
committerHartmut Birr <osexpert@googlemail.com>
Mon, 1 Apr 2002 22:03:56 +0000 (22:03 +0000)
svn path=/trunk/; revision=2807

reactos/lib/msvcrt/sys_stat/fstat.c

index fca4278..b19cb26 100644 (file)
@@ -26,6 +26,14 @@ int _fstat(int fd, struct stat *statbuf)
       return -1;
     }
 
+  if (fd >= 0 && fd <= 4)
+  {
+    memset(statbuf, 0, sizeof(struct stat));
+    statbuf->st_dev = fd;
+    statbuf->st_mode = S_IFCHR;
+    return 0;
+  }
+
   if (!GetFileInformationByHandle(_get_osfhandle(fd),&FileInformation))
     {
       __set_errno(EBADF);