aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-12-28 07:10:34 +0000
committerChristopher Faylor <me@cgf.cx>2002-12-28 07:10:34 +0000
commita62bc51b71fcf5a1ec2d3c68a5634da59cc7c4f6 (patch)
treef6e3970795b75f6ae7dc2e4d8c8a2c7346201ccc
parent1ad7898674f59c5f213d7d9e52178946d005c53f (diff)
downloadnewlib-unlabeled-1.65.12.zip
newlib-unlabeled-1.65.12.tar.gz
newlib-unlabeled-1.65.12.tar.bz2
Introduce device class to cygwin throughout. Rename FH_DISK to FH_FSgithub/unlabeled-1.65.12unlabeled-1.65.12
throughout. * dcrt0.cc (dll_crt0_1): Initialize device globals via device::init. * dtable.cc (dtable::init_std_file_from_handle): Use device numbers rather than names when they are known. Should speed up process startup slightly. (dtable::build_fhandler_from_name): Pass path_conv device to build_fhandler. (dtable::build_fhandler): Accept device argument rather than separate device/unit arguments. (dtable::build_fhandler): Ditto. Separate switch statement by devices which take units and those which don't. Build unix/win32 names from device if required. (dtable::dup_worker): Reflect changes to build_fhandler arguments. * dtable.h (dtable::build_fhandler): Ditto. * fhandler.cc (fhandler_base::set_name): Eliminate unit argument. Use get_unit to derive unit. * fhandler.h: Separate FH device defines into devices.h include. Define is_slow as appropriate for each fhandler_class. (fhandler_base::dev): New element. (fhandler_base::fhandler_base): Eliminate unit argument. (fhandler_base::get_device): Return device number. (fhandler_base::get_major): Return device major number. (fhandler_base::get_minor): Return device minor number. (fhandler_base::get_unit): Ditto. (fhandler_base::get_native_name): Return device format field. (fhandler_fifo): New class. (select_stuff::device_specific): Remove array. (select_stuff::device_specific_pipe): New class element. (select_stuff::device_specific_socket): New class element. (select_stuff::device_specific_serial): New class element. (select_stuff::select_stuff): Initialize new elements. * fhandler_disk_file.cc (fhandler_cygdrive::fhandler_cygdrive): Remove unit initialization. * fhandler_tty.cc (fhandler_tty_master::init_console): Use "console_dev" global to initialize captive console used by tty master. * mmap.cc (mmap_record::devtype_): Remove. (mmap_record::dev): New. (mmap_record::mmap_record): Use dev. (mmap_record::get_device): Implement via dev. * net.cc (fdsock): Use socket_dev global to initialize socket fhandler. * path.cc (path_conv::check): Accommodate new path_conv::dev element. (get_devn): Eliminate. (get_raw_device_number): Ditto. (get_device_number): Ditto. (win32_device_name): Accept dev argument. Use it. Use device::parse to derive potential device name. (mount_info::conv_to_win32_path): Accept dev argument. Use it. * path.h (path_conv::devn): Eliminate. (path_conv::unit): Ditto. (path_conv::dev): Declare. (path_conv::path_conv): Don't initialize deleted members. (path_conv::is_device): Implement via dev element. (path_conv::get_devn): Ditto. (path_conv::get_unitn): Ditto. * pipe.cc (make_pipe): Use pipe[rw]_dev in fhandler construction. * select.cc: Use new device_specific_* select class elements * shared_info.h (CURR_MOUNT_MAGIC): Update. (mount_info::conv_to_win32_path): Reflect new arguments. * syscalls.cc (fstat64): Just use get_device() without interpretation for st_dev element. (stat_worker): Ditto. * tty.cc (create_tty_master): Use ttym_dev in fhandler constructor. (tty::common_init): Check for tty major device number rather than FH_TTYM.
-rw-r--r--winsup/cygwin/mmap.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index 19c8e08..128b109 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -43,26 +43,26 @@ class mmap_record
private:
int fdesc_;
HANDLE mapping_handle_;
- int devtype_;
DWORD access_mode_;
__off64_t offset_;
DWORD size_to_map_;
caddr_t base_address_;
DWORD *map_map_;
+ device dev;
public:
mmap_record (int fd, HANDLE h, DWORD ac, __off64_t o, DWORD s, caddr_t b) :
fdesc_ (fd),
mapping_handle_ (h),
- devtype_ (0),
access_mode_ (ac),
offset_ (o),
size_to_map_ (s),
base_address_ (b),
map_map_ (NULL)
{
+ dev.devn = 0;
if (fd >= 0 && !cygheap->fdtab.not_open (fd))
- devtype_ = cygheap->fdtab[fd]->get_device ();
+ dev = cygheap->fdtab[fd]->dev;
}
/* Default Copy constructor/operator=/destructor are ok */
@@ -70,7 +70,7 @@ class mmap_record
/* Simple accessors */
int get_fd () const { return fdesc_; }
HANDLE get_handle () const { return mapping_handle_; }
- DWORD get_device () const { return devtype_; }
+ device& get_device () { return dev; }
DWORD get_access () const { return access_mode_; }
DWORD get_offset () const { return offset_; }
DWORD get_size () const { return size_to_map_; }
@@ -486,7 +486,7 @@ mmap64 (caddr_t addr, size_t len, int prot, int flags, int fd, __off64_t off)
return MAP_FAILED;
}
fh = cfd;
- if (fh->get_device () == FH_DISK)
+ if (fh->get_device () == FH_FS)
{
DWORD high;
DWORD low = GetFileSize (fh->get_handle (), &high);