aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-12-29 06:14:20 +0000
committerChristopher Faylor <me@cgf.cx>2002-12-29 06:14:20 +0000
commitfb0de47671dd8d0b16dc6708f70a33a47976de0e (patch)
tree54fd6a7027b8209a3e6052b796a10da3296f1f51
parentc31fd0f195a5bc7b39a0a81eed57e32b488e0a3d (diff)
downloadnewlib-fb0de47671dd8d0b16dc6708f70a33a47976de0e.zip
newlib-fb0de47671dd8d0b16dc6708f70a33a47976de0e.tar.gz
newlib-fb0de47671dd8d0b16dc6708f70a33a47976de0e.tar.bz2
* cygwin-gperf: New file.
* Makefile.in: Use cygwin-gperf script to build devices.cc. * configure.in: Remove some comments. * configure: Regenerate. * devices.gperf: Remove max unit determination from FH_TTY. Add /dev/kmem. Add /dev/fifo. Add /dev/rawdrive. Remove specific "const device *" declarations since they are now autogenerated. (device::parse): Treat FH_TTY specially. Move logic for determining real tty device to separate function. (device::init): Reduce to nothing. (device::parse): New function taking different arguments. (device::parse): Ditto. (device::tty_to_real_device): New function. * devices.h (struct device): Define above new functions. (device::dev_on_fs): New element. (device::setfs): New function. (device::isfs): Ditto. * dtable.cc (dtable::build_fhandler): Treat FH_TTY specially. * fhandler.cc (fhandler_base::set_name): Make special determination for non-disk-resident devices. * fhandler.h (fhandler_base::isdevice): Renamed from 'is_device'. (fhandler_disk_file::isdevice): Ditto. (fhandler_base::is_auto_device): New function. (fhandler_base::is_fs_device): New function. (fhandler_tty_slave::get_unit): Declare. (fhandler_disk_file::readdir): Take special .lnk consideration for devices as well as symlinks. * fhandler_tty.cc: Use get_unit () rather than dev.minor throughout. (fhandler_tty_slave::get_unit): Define new function. * path.cc (symlink_info::major): New element. (symlink_info::major): Ditto. (symlink_info::devtype): Ditto. (path_conv::check): Handle devices detected by symlink_info::check. (win32_device_name): Eliminate special FH_TTY handling. (symlink): Move bulk of procesing to symlink_worker. (symlink_worker): New function. Handles devices. (symlink_info::parse_device): Parse info from potential device file into symlink_info elements. (symlink_info::check): If contents of .lnk file begin with a ':' then treat the file as a device file. * path.h (isdevice): Renamed from is_device. (is_auto_device): New function. (is_fs_device): Ditto. * syscalls.cc (chown_worker): Allow setting of ownership for on-disk devices. (chmod): Ditto. (mknod): Implement. * winsup.h (symlink_worker): Declare.
-rw-r--r--winsup/cygwin/fhandler.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 246ffde..9edec14 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -303,7 +303,7 @@ class fhandler_base
virtual int tcsetpgrp (const pid_t pid);
virtual int tcgetpgrp ();
virtual int is_tty () { return 0; }
- virtual BOOL is_device () { return TRUE; }
+ virtual bool isdevice () { return true; }
virtual char *ptsname () { return NULL;}
virtual class fhandler_socket *is_socket () { return 0; }
virtual class fhandler_console *is_console () { return 0; }
@@ -342,6 +342,8 @@ class fhandler_base
virtual void rewinddir (DIR *);
virtual int closedir (DIR *);
virtual bool is_slow () {return 0;}
+ bool is_auto_device () {return isdevice () && !dev.isfs ();}
+ bool is_fs_device () {return dev.isfs ();}
};
class fhandler_socket: public fhandler_base
@@ -566,7 +568,7 @@ class fhandler_disk_file: public fhandler_base
int open (path_conv *real_path, int flags, mode_t mode);
int close ();
int lock (int, struct flock *);
- BOOL is_device () { return FALSE; }
+ bool isdevice () { return false; }
int __stdcall fstat (struct __stat64 *buf, path_conv *pc) __attribute__ ((regparm (3)));
int __stdcall fstat_helper (struct __stat64 *buf, path_conv *pc,
FILETIME ftCreateionTime,
@@ -883,6 +885,7 @@ class fhandler_tty_slave: public fhandler_tty_common
__off64_t lseek (__off64_t, int) { return 0; }
select_record *select_read (select_record *s);
int cygserver_attach_tty (HANDLE*, HANDLE*);
+ int get_unit () __attribute__ ((regparm (1)));
};
class fhandler_pty_master: public fhandler_tty_common