Cygwin: strptime: add release note
[newlib-cygwin.git] / winsup / cygwin / fhandler / zero.cc
blob9d8fe004dabaeeb075bc7f15172a66e1d64939b8
1 /* fhandler_dev_zero.cc: code to access /dev/zero
3 Written by DJ Delorie (dj@cygnus.com)
5 This file is part of Cygwin.
7 This software is a copyrighted work licensed under the terms of the
8 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
9 details. */
11 #include "winsup.h"
12 #include "security.h"
13 #include "cygerrno.h"
14 #include "path.h"
15 #include "fhandler.h"
17 fhandler_dev_zero::fhandler_dev_zero ()
18 : fhandler_base ()
22 ssize_t
23 fhandler_dev_zero::write (const void *, size_t len)
25 if (get_device () == FH_FULL)
27 set_errno (ENOSPC);
28 return -1;
30 return len;
33 void
34 fhandler_dev_zero::read (void *ptr, size_t& len)
36 memset (ptr, 0, len);