OSDN Git Service

* fhandler.h (class fhandler_dev_raw): Add method fstat.
authorcorinna <corinna>
Tue, 30 Sep 2003 21:43:40 +0000 (21:43 +0000)
committercorinna <corinna>
Tue, 30 Sep 2003 21:43:40 +0000 (21:43 +0000)
* fhandler_raw.cc (fhandler_dev_raw::fstat): New method.

Add missing ChangeLog for previous patch.

winsup/cygwin/ChangeLog
winsup/cygwin/fhandler.h
winsup/cygwin/fhandler_raw.cc

index bfe73b6..c28841e 100644 (file)
@@ -1,3 +1,18 @@
+2003-09-30  Corinna Vinschen  <corinna@vinschen.de>
+
+       * fhandler.h (class fhandler_dev_raw): Add method fstat.
+       * fhandler_raw.cc (fhandler_dev_raw::fstat): New method.
+
+2003-09-30  Corinna Vinschen  <corinna@vinschen.de>
+
+       * devices.h (enum fh_devices): Remove DEV_RAWDRIVE_MAJOR and
+       FH_RAWDRIVE.
+       * devices.shilka (dev_rawdrive_storage): Remove.
+       (unit_devices): Remove pointer to dev_rawdrive_storage.
+       (uniq_devices): Remove rawdrive entry.
+       * dtable.cc (build_fh_pc): Remove DEV_RAWDRIVE_MAJOR case.
+       * path.cc (win32_device_name): ditto.
+
 2003-09-29  Corinna Vinschen  <corinna@vinschen.de>
 
        * syslog.cc (vsyslog): Print debug message if ReportEventA fails.
index 9451676..26aedd2 100644 (file)
@@ -527,6 +527,8 @@ class fhandler_dev_raw: public fhandler_base
   void raw_read (void *ptr, size_t& ulen);
   int raw_write (const void *ptr, size_t ulen);
 
+  int __stdcall fstat (struct __stat64 *buf) __attribute__ ((regparm (2)));
+
   int dup (fhandler_base *child);
 
   int ioctl (unsigned int cmd, void *buf);
index 38ef837..ba74d7e 100644 (file)
@@ -129,6 +129,31 @@ fhandler_dev_raw::~fhandler_dev_raw (void)
   clear ();
 }
 
+int __stdcall
+fhandler_dev_raw::fstat (struct __stat64 *buf)
+{
+  debug_printf ("here");
+
+  switch (get_device ())
+    {
+    case FH_TAPE:
+    case FH_NTAPE:
+      buf->st_mode = S_IFCHR | STD_RBITS | STD_WBITS | S_IWGRP | S_IWOTH;
+      break;
+    default:
+      buf->st_mode = S_IFBLK | STD_RBITS | STD_WBITS | S_IWGRP | S_IWOTH;
+      break;
+    }
+
+  buf->st_uid = geteuid32 ();
+  buf->st_gid = getegid32 ();
+  buf->st_nlink = 1;
+  buf->st_blksize = S_BLKSIZE;
+  time_as_timestruc_t (&buf->st_ctim);
+  buf->st_atim = buf->st_mtim = buf->st_ctim;
+  return 0;
+}
+
 int
 fhandler_dev_raw::open (int flags, mode_t)
 {