summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_floppy.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-12-14 15:54:33 +0000
committerCorinna Vinschen <corinna@vinschen.de>2005-12-14 15:54:33 +0000
commite3d14af155fb84890a32fad7f7706967ac5bc7d9 (patch)
tree05df3064a2c24a1542e182a3aa2d5ff4e3df8f56 /winsup/cygwin/fhandler_floppy.cc
parent10cba930d401056aed4b2fb360b5e084d61ecabb (diff)
downloadcygnal-e3d14af155fb84890a32fad7f7706967ac5bc7d9.tar.gz
cygnal-e3d14af155fb84890a32fad7f7706967ac5bc7d9.tar.bz2
cygnal-e3d14af155fb84890a32fad7f7706967ac5bc7d9.zip
* fhandler.cc (fhandler_base::open_9x): Handle O_SYNC and O_DIRECT
flags. (fhandler_base::open): Ditto. * fhandler_floppy.cc (fhandler_dev_floppy::open): Don't allocate devbuf in O_DIRECT case. * fhandler_raw.cc (fhandler_dev_raw::ioctl): Don't allow buffer changes in O_DIRECT case. Allow returning a buffer size 0, which indicates O_DIRECT. * fhandler_tape.cc (fhandler_dev_tape::open): Use O_SYNC flag to hand down the !buffer_writes case. Don't allocate devbuf in O_DIRECT case. (fhandler_dev_tape::raw_read): Don't mess with devbuf if it's NULL. * include/fcntl.h: Define _FDIRECT, O_DIRECT, O_DSYNC and O_RSYNC. * include/cygwin/version.h: Bump API minor version.
Diffstat (limited to 'winsup/cygwin/fhandler_floppy.cc')
-rw-r--r--winsup/cygwin/fhandler_floppy.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler_floppy.cc b/winsup/cygwin/fhandler_floppy.cc
index 3bc9f5191..a8b99b266 100644
--- a/winsup/cygwin/fhandler_floppy.cc
+++ b/winsup/cygwin/fhandler_floppy.cc
@@ -161,9 +161,10 @@ fhandler_dev_floppy::open (int flags, mode_t)
relatively big value increases performance by means. The new ioctl call
with 'rdevio.h' header file supports changing this value.
- Let's try to be smart: Let's take a multiple of typical tar and cpio
- buffer sizes by default. */
- devbufsiz = 61440L;
+ As default buffer size, we're using some value which is a multiple of
+ the typical tar and cpio buffer sizes, Except O_DIRECT is set, in which
+ case we're not buffering at all. */
+ devbufsiz = (flags & O_DIRECT) ? 0L : 61440L;
int ret = fhandler_dev_raw::open (flags);
if (ret && get_drive_info (NULL))