Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler/null.cc')
-rw-r--r--winsup/cygwin/fhandler/null.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler/null.cc b/winsup/cygwin/fhandler/null.cc
new file mode 100644
index 000000000..e4dec35e1
--- /dev/null
+++ b/winsup/cygwin/fhandler/null.cc
@@ -0,0 +1,35 @@
+/* null.cc. /dev/null specifics.
+
+This file is part of Cygwin.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+#include "winsup.h"
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/uio.h>
+#include <cygwin/acl.h>
+#include <sys/param.h>
+#include "cygerrno.h"
+#include "perprocess.h"
+#include "security.h"
+#include "cygwin/version.h"
+#include "path.h"
+#include "fhandler.h"
+
+fhandler_dev_null::fhandler_dev_null () :
+ fhandler_base ()
+{
+}
+
+ssize_t
+fhandler_dev_null::write (const void *ptr, size_t len)
+{
+ /* Shortcut. This also fixes a problem with the NUL device on x86_64:
+ If you write > 4 GB in a single attempt, the bytes written returned
+ from by is numBytes & 0xffffffff. */
+ return len;
+}
+