aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/fhandler.h
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2012-03-29 18:02:54 +0000
committerCorinna Vinschen <corinna@vinschen.de>2012-03-29 18:02:54 +0000
commit9ca7bca3c381d4affa78b450bd7284da9a68ec9b (patch)
treeb411492e1997760f201f1bac335296211e5ddec3 /winsup/cygwin/fhandler.h
parentd46ed263afc680ce6a7f84114a3014b84e447987 (diff)
downloadnewlib-9ca7bca3c381d4affa78b450bd7284da9a68ec9b.zip
newlib-9ca7bca3c381d4affa78b450bd7284da9a68ec9b.tar.gz
newlib-9ca7bca3c381d4affa78b450bd7284da9a68ec9b.tar.bz2
* Makefile.in (DLL_OFILES): Add fhandler_dev.o.
* devices.h (DEV_DEV_MAJOR): Define. (FH_DEV): Redefine in terms of DEV_DEV_MAJOR. (ext_dev_storage): Declare. (dev_storage_size): Declare. (dev_dev_storage): Declare. (dev_dev): Define. (isdev_dev): Define. * devices.in (dev_dev_storage): Activate. (ext_dev_storage): Define as externally available pointer to dev_storage. (dev_storage_size): Define to contain number of dev_storage elements. * dir.cc (rmdir): Handle /dev as always not empty. * dtable.cc (fh_alloc): Handle DEV_DEV_MAJOR. * fhandler.h (fhandler_dev): New class, derived from fhandler_disk_file. (fhandler_union): Add fhandler_dev member. * fhandler_disk_file.cc (class __DIR_mounts): Handle /dev directory to make sure it always exists. * fhandler_dev.cc: New file implementing /dev. * globals.cc (ro_u_dev): New R/O unicode string. * path.cc (path_conv::check): Handle FH_DEV device.
Diffstat (limited to 'winsup/cygwin/fhandler.h')
-rw-r--r--winsup/cygwin/fhandler.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 533a9d4..4cdf81e 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -1016,6 +1016,34 @@ class fhandler_disk_file: public fhandler_base
}
};
+class fhandler_dev: public fhandler_disk_file
+{
+ int lastrealpos;
+ bool dir_exists;
+public:
+ fhandler_dev ();
+ DIR *opendir (int fd) __attribute__ ((regparm (2)));
+ int readdir (DIR *, dirent *) __attribute__ ((regparm (3)));
+ void rewinddir (DIR *);
+
+ fhandler_dev (void *) {}
+
+ void copyto (fhandler_base *x)
+ {
+ x->pc.free_strings ();
+ *reinterpret_cast<fhandler_dev *> (x) = *this;
+ x->reset (this);
+ }
+
+ fhandler_dev *clone (cygheap_types malloc_type = HEAP_FHANDLER)
+ {
+ void *ptr = (void *) ccalloc (malloc_type, 1, sizeof (fhandler_dev));
+ fhandler_dev *fh = new (ptr) fhandler_dev (ptr);
+ copyto (fh);
+ return fh;
+ }
+};
+
class fhandler_cygdrive: public fhandler_disk_file
{
enum
@@ -2093,6 +2121,7 @@ typedef union
{
char __base[sizeof (fhandler_base)];
char __console[sizeof (fhandler_console)];
+ char __dev[sizeof (fhandler_dev)];
char __cygdrive[sizeof (fhandler_cygdrive)];
char __dev_clipboard[sizeof (fhandler_dev_clipboard)];
char __dev_dsp[sizeof (fhandler_dev_dsp)];