aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog15
-rw-r--r--winsup/cygwin/fhandler.h2
-rw-r--r--winsup/cygwin/fhandler_raw.cc25
3 files changed, 42 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index bfe73b6..c28841e 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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.
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 9451676..26aedd2 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -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);
diff --git a/winsup/cygwin/fhandler_raw.cc b/winsup/cygwin/fhandler_raw.cc
index 38ef837..ba74d7e 100644
--- a/winsup/cygwin/fhandler_raw.cc
+++ b/winsup/cygwin/fhandler_raw.cc
@@ -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)
{