Untangled crtdll/msvcrt header mess.
[reactos.git] / reactos / lib / msvcrt / io / read.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/crtdll/io/read.c
5 * PURPOSE: Reads a file
6 * PROGRAMER: Boudewijn Dekker
7 * UPDATE HISTORY:
8 * 28/12/98: Created
9 */
10 #include <windows.h>
11 #include <msvcrt/io.h>
12
13 size_t _read(int _fd, void *_buf, size_t _nbyte)
14 {
15 DWORD _rbyte;
16
17 if (!ReadFile(_get_osfhandle(_fd),_buf,_nbyte,&_rbyte,NULL))
18 {
19 return -1;
20 }
21 return (size_t)_rbyte;
22 }