* 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.
This commit is contained in:
Corinna Vinschen
2012-03-29 18:02:54 +00:00
parent d46ed263af
commit 9ca7bca3c3
12 changed files with 325 additions and 37 deletions

View File

@@ -1,6 +1,6 @@
/* devices.h
Copyright 2002, 2003, 2004, 2005, 2007, 2009, 2010, 2011 Red Hat, Inc.
Copyright 2002, 2003, 2004, 2005, 2007, 2009, 2010, 2011, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -68,7 +68,6 @@ enum fh_devices
FH_FIFO = FHDEV (0, 196),
FH_FS = FHDEV (0, 195), /* filesystem based device */
FH_NETDRIVE= FHDEV (0, 194),
FH_DEV = FHDEV (0, 193),
DEV_FLOPPY_MAJOR = 2,
FH_FLOPPY = FHDEV (DEV_FLOPPY_MAJOR, 0),
@@ -243,6 +242,9 @@ enum fh_devices
DEV_CYGDRIVE_MAJOR = 98,
FH_CYGDRIVE= FHDEV (DEV_CYGDRIVE_MAJOR, 0),
DEV_DEV_MAJOR = 99,
FH_DEV= FHDEV (DEV_DEV_MAJOR, 0),
DEV_TCP_MAJOR = 30,
FH_TCP = FHDEV (DEV_TCP_MAJOR, 36),
FH_UDP = FHDEV (DEV_TCP_MAJOR, 39),
@@ -316,6 +318,9 @@ struct device
inline bool is_fs_special () const {return dev_on_fs && d.devn != FH_FS;}
};
extern const device *ext_dev_storage;
extern const size_t dev_storage_size;
extern const device *console_dev;
extern const device *ptmx_dev;
extern const device *ptys_dev;
@@ -336,6 +341,8 @@ extern const device dev_pipew_storage;
#define pipew_dev (&dev_pipew_storage)
extern const device dev_proc_storage;
#define proc_dev (&dev_proc_storage)
extern const device dev_dev_storage;
#define dev_dev (&dev_dev_storage)
extern const device dev_netdrive_storage;
#define netdrive_dev (&dev_netdrive_storage)
extern const device dev_cygdrive_storage;
@@ -348,6 +355,8 @@ extern const device dev_fs_storage;
#define isproc_dev(devn) \
(devn >= FH_PROC_MIN_MINOR && devn <= FH_PROC_MAX_MINOR)
#define isdev_dev(devn) (devn == FH_DEV)
#define isprocsys_dev(devn) (devn == FH_PROCSYS)
#define isvirtual_dev(devn) \