migrate substitution keywords to SVN
[reactos.git] / reactos / lib / crtdll / io / read.c
1 /* $Id$
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS system libraries
5 * FILE: lib/crtdll/io/read.c
6 * PURPOSE: Reads a file
7 * PROGRAMER: Boudewijn Dekker
8 * UPDATE HISTORY:
9 * 28/12/1998: Created
10 */
11
12 #include "precomp.h"
13 #include <msvcrt/io.h>
14 #include <msvcrt/internal/file.h>
15
16 #define NDEBUG
17 #include <msvcrt/msvcrtdbg.h>
18
19 /*
20 * @implemented
21 */
22 size_t _read(int _fd, void *_buf, size_t _nbyte)
23 {
24 DWORD _rbyte;
25
26 if (!ReadFile(_get_osfhandle(_fd),_buf,_nbyte,&_rbyte,NULL))
27 {
28 return -1;
29 }
30 return (size_t)_rbyte;
31 }